comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: file date
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: file date [message #10343 is a reply to message #10334] Wed, 19 November 1997 00:00 Go to previous message
Christian Soeller is currently offline  Christian Soeller
Messages: 46
Registered: August 1996
Member
Martin Schultz <mgs@io.harvard.edu> writes:

>
> Hi,
>
> is there any way to figure out the modification date of a given file in
> IDL ? I searched the manual but couldn't find anything. Unfortunately
> there is no such field in FSTAT. What I am trying to do is put together
> a small utitlity which would perform semi-automatic updates of my
> website library. Has anyone done such things before ?
>

I am not aware of a function inside idl that would do this. However, if
you're on a unix system you should have the 'stat' command somewhere that,
on my system, prints the file modification time in seconds since 1970
if invoked as

stat -mq filename

So all you have to do inside idl is

function modtime, filename

exists = findfile(filename)
if (exists(0) eq '') then message, 'file '+filename+' not found'

spawn, 'stat -mq '+filename, mtime

return, long(mtime)
end

For other invocations of stat see 'man stat'. The only drawback doing it
like this is the 'bizarre' signal handling of IDL that can cause
'spawn' to hang (at least that was true with IDL4X). If you have no fear
of C coding you could code a stat system call in C and pass the field(s)
your interested in with a home built routine using 'call_external'.

Hope this helps,

Christian

------------------------------------------------------------ --------
Christian Soeller mailto: csoelle@sghms.ac.uk
St. Georges Hospital Medical School Dept. of Pharmacology
Cranmer Terrace London SW17 0RE
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Different Platforms
Next Topic: IDL routine to load USGS digital elevation datat sets .dem extensions

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 22:27:32 PDT 2025

Total time taken to generate the page: 1.43971 seconds