|
Re: Return the name of the last (newest) file ? [message #31767 is a reply to message #31675] |
Wed, 14 August 2002 09:49  |
Pavel A. Romashkin
Messages: 531 Registered: November 2000
|
Senior Member |
|
|
I am sorry, I must have missed some fine point, but why not use simply
pro get_newest
temp = findfile("*", count=n_files)
date = lon64arr(n_files)
for i = 0, n_files - 1 do begin
openr, 100, temp[i]
date[i] = (fstat(100)).mtime
close, 100
endfor
file_index = where(date eq max(date))
print, temp[file_index]
end
This would work not just on Unix.
Pavel
Kolbjorn Bekkelund wrote:
>
> Hi.
>
> I'm modifying an old IDL-routine (under Linux and IDL 5.4), plotting some of our ozone lidar data.
> This has to be done manually today, but I'm working against an automation
> of this job now. The final stage here is to have IDL run by cron, finding the last
> (newest) file by itself and process it.
|
|
|