Am Mittwoch, 4. Februar 2015, 22:34:57 schrieb Marcos Cruz:
> 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.

The C interface is the right thing to get access to stat/lstat/fstat.
Gforth git head has those already in unix/filestat.fs

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/
net2o ID: kQusJzA;7*?t=uy@X}1GWr!+0qqp_Cn176t4(dQ*


Reply via email to