From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/67331 Path: news.gmane.org!not-for-mail From: Marco Newsgroups: gmane.comp.tex.context Subject: Re: Use date of the tex file in the document Date: Thu, 24 Mar 2011 12:00:17 +0100 Message-ID: <20110324120017.78d5e9b9@glyph> References: <20110324102202.GD3626@orcus> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1300964457 21606 80.91.229.12 (24 Mar 2011 11:00:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 24 Mar 2011 11:00:57 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Thu Mar 24 12:00:53 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q2iHa-00020D-AX for gctc-ntg-context-518@m.gmane.org; Thu, 24 Mar 2011 12:00:50 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E8C1BCAB31; Thu, 24 Mar 2011 12:00:35 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 8XVTQfog6A3X; Thu, 24 Mar 2011 12:00:33 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 602E5CAB46; Thu, 24 Mar 2011 12:00:23 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id BF26BCAAFF for ; Thu, 24 Mar 2011 12:00:21 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id yvZ71a5G-xa4 for ; Thu, 24 Mar 2011 12:00:19 +0100 (CET) Original-Received: from filter1-nij.mf.surf.net (filter1-nij.mf.surf.net [195.169.124.152]) by balder.ntg.nl (Postfix) with ESMTP id 5E916CAB46 for ; Thu, 24 Mar 2011 12:00:16 +0100 (CET) Original-Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by filter1-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p2OB0TDL008962 for ; Thu, 24 Mar 2011 12:00:29 +0100 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Q2iHE-0001q6-QY for ntg-context@ntg.nl; Thu, 24 Mar 2011 12:00:28 +0100 Original-Received: from miun108-70.dynamic.miun.se ([193.10.108.70]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 24 Mar 2011 12:00:28 +0100 Original-Received: from netuse by miun108-70.dynamic.miun.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 24 Mar 2011 12:00:28 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 28 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: miun108-70.dynamic.miun.se X-Newsreader: Claws Mail 3.7.6 (GTK+ 2.22.0; x86_64-pc-linux-gnu) X-Bayes-Prob: 0.3296 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=80.91.229.12; country=NO; latitude=62.0000; longitude=10.0000; http://maps.google.com/maps?q=62.0000,10.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 07EmX0tkN - 292b363f3196 - 20110324 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.152 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:67331 Archived-At: On 2011-03-24 Philipp Gesang wrote: This should also work: \starttext \startluacode function modification_date (file) local f = file local attr = lfs.attributes (f) assert (type(attr) == "table") if attr.mode ~= "directory" then return os.date("%Y-%m-%d %H:%M",attr.modification) end end \stopluacode \unexpanded\def\getdate{% \ctxlua{context(modification_date ("\jobname.tex"))}% } \getdate \stoptext Marco ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________