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 #10339 is a reply to message #10334] Wed, 19 November 1997 00:00 Go to previous messageGo to previous message
R. Bauer is currently offline  R. Bauer
Messages: 137
Registered: November 1996
Senior Member
Martin Schultz wrote:

> 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 ?



Yes,

This is my true idl function. But it will only work I believe on unix
Systems.
I'll be lucky if someone could add the posibilities for PC's.

The trick is that's I use findfile whith parameters allowed by "ls"!



;
; Copyright (c) 1997, Forschungszentrum Juelich GmbH ICG-1
; All rights reserved.
; Unauthorized reproduction prohibited.
;
; This software may be used, copied, or redistributed as long as it
is not
; sold and this copyright notice is reproduced on each copy made.
This
; routine is provided as is without any express or implied
warranties
; whatsoever.
;+
; NAME:
; get_date_of_file
;
; PURPOSE:
; This function reads the modification time stamp from a given path and
file
;
; CATEGORY:
; CASE_TOOLS
;
;
; CALLING SEQUENCE:
; result=get_date_of_file(path,file_name)
;
;
; INPUTS:
; path: the path where the file is in
; file_name: the name of the file
;
;
; OUTPUTS:
; This function returns the time stamp of the give file
;
;
; EXAMPLE:
; result=get_date_of_file('/','test')
;
;
; MODIFICATION HISTORY:
; Written by: R.Bauer (ICG-1), Nov. 16 1997
;-


function get_date_of_file,dir, file_name

case strlowcase(!version.os) of
'aix' : slash_s = '/'
'linux' : slash_s ='/'
'windows' : slash_s ='\'
else:
endcase

openr,10,dir+slash_s+file_name,error=err
close,10
if err ne 0 then return,-1

info= str_sep(strcompress((findfile('-Fdl '+dir+slash_s+file_name))(0)),'
')

n_info=n_elements(info)-1

only_time=info(n_info-3:n_info-1)

a_year=(str_sep(systime(0),' '))(4)

if strpos(only_time(2),':') gt -1 then only_time(2)=a_year
only_time=arr2string(only_time,sep='-')
return,only_time

end

R.Bauer

--
R.Bauer

Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
[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: Fri Oct 10 09:09:22 PDT 2025

Total time taken to generate the page: 0.16702 seconds