Getting File creation data/time [message #14716] |
Mon, 22 March 1999 00:00 |
Armand J. L. Jongen
Messages: 9 Registered: April 1997
|
Junior Member |
|
|
Hi,
I am probably missing something completely but I am not able to find a
function/routine to get a file creation data/time. The obvious
work-around (Win9x, IDL 5.2):
FileName=Dialog_pickfile(/read)
; Pipeline the output of the dir command to a file
DOSCommand='dir '+FileName+' > datetime.txt'
Spawn, DosCommand
; Open the fie, read the output and delete it after closing
OpenR, lun, 'datetime.txt', /Get_Lun, /Delete
Skip=StrArr(6)
Readf, lun, Skip
Close, lun
Free_lun, lun
; Pull out the dat and time fields
Pieces=STRTRIM(STR_Sep(Skip[5], ' '),2)
Pieces=Pieces(Where(Pieces NE ''))
FileDate=Pieces[3]
FileTime=Pieces[4]
failes when there are spaces in the FileName, as the dir-command is
unable to handle these. Before writing a little piece of C-code to do
the job I wondered if somebody has any suggestions.
Ta!
Armand
|
|
|