[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: [sqr-users] check datetime stamp on file




To see if the file exists, simply try to open it for reading - if it
does not exist you will get an error code.

open $filename    as 6  for-reading record=132:vary status=#filestat

In this case, the #filestat variable would end up with 0 or -1
depending on the success.  0 means the file is there and readable, -1
means something prevents you from opening it for reading (file
permissions and even file locking could also cause such a failure).  

Getting the date/time isn't as easy.  

One way would be to call system and perform a directory listing of the
file you want to check, and parse it.   Of course that's very messy and
platform specific.  

-----------------------------------------------------
James Harris
Junior Systems Programmer/Analyst
Information Technology Division
Frederick Community College
-----------------------------------------------------

>>> lakef250@yahoo.com 8/30/2004 11:05:17 AM >>>
RESEND:
Anyone know how to determine datetime of a file programmatically?  


Yuri Lakef <lakef250@yahoo.com> wrote:Greetings to all,

I'd like to add a procedure in my SQR to call the operating system and
check if a file exists or not (SQR reads a file and loads a table). If
it does exist, I'd like to check the datetime stamp for the file and
only process if it matches "today's date." 

Are there operating system (or better yet, SQR) functions/features that
allow this? We're on Unix AIX and NT.

Much thanks!



                
---------------------------------
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org 
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users