gforth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gforth] better way to get a file mtime from the OS?


From: Marcos Cruz
Subject: [gforth] better way to get a file mtime from the OS?
Date: Wed, 4 Feb 2015 22:34:57 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

I need to compare the modification time of files.  It seems there's no
way to get it but using the host OS, right?  I've written this:

        : file-mtime  ( ca1 len1 -- ca2 len2 )
          \ Modification time of a file
          \ ca1 len1 = filename
          \ ca2 len2 = modification time, as an ISO date string
          s" stat --format=%y " 2swap s+ s" > /tmp/galope.file-mtime" s+ system
          s" /tmp/galope.file-mtime" slurp-file
          ;

Is there a better way to get the data from the shell than writing and
reading a temporary file? 'getenv' and pipes are useless in this case, I
think.

Thank you.

-- 
Marcos Cruz
http://programandala.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]