Re: Getting File creation data/time [message #14692] |
Tue, 23 March 1999 00:00 |
Armand J. L. Jongen
Messages: 9 Registered: April 1997
|
Junior Member |
|
|
Phillip & Suzanne David wrote:
>
> Try this:
>
> FileName=Dialog_pickfile(/read)
>
> ; Pipeline the output of the dir command to a file
>
> DOSCommand='dir "'+FileName+'"' ; Add quotes around the file name
Briljant! It does the trick..... only:
> Spawn, DosCommand, Result ; You don't have to send the results to a
> file. They get sent back in 'Result'
doesn't work on a Window$ machine as also mentioned in the help files:
; IDLHELP***************************************************** *******
Result
A named variable in which to place the output from the child process.
Each line of output becomes a single array element. If Result is not
present, the output from the child shell process goes to the standard
output.
Under Windows and the Macintosh OS, Result has no effect.
; IDLHELP***************************************************** *******
But then I can use the temp-file trick.
Thanks,
Armand
|
|
|
Re: Getting File creation data/time [message #14696 is a reply to message #14692] |
Mon, 22 March 1999 00:00  |
Phillip & Suzanne
Messages: 31 Registered: June 1998
|
Member |
|
|
Try this:
FileName=Dialog_pickfile(/read)
; Pipeline the output of the dir command to a file
DOSCommand='dir "'+FileName+'"' ; Add quotes around the file name
Spawn, DosCommand, Result ; You don't have to send the results to a
file. They get sent back in 'Result'
; Pull out the dat and time fields
Pieces=STRTRIM(STR_Sep(Result, ' '),2)
Pieces=Pieces(Where(Pieces NE ''))
...
At this point, you'll have to mess with which pieces to parse, as I don't have
a Windows machine to figure them out on. The basic idea is to use the double
quotes as part of the command, and to return the result directly from the
spawn command. Hope this helps.
Phillip
|
|
|