Normal Topic Get filedate of a selected file? (Read 543 times)
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Get filedate of a selected file?
Jun 12th, 2009 at 12:40pm
Print Post Print Post  
Hello!

How can i get filedate of a selected file (XP/Vista)?
Using  @RedirectProcess() ?

Thanks.
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Get filedate of a selected file?
Reply #1 - Jun 12th, 2009 at 4:07pm
Print Post Print Post  
No access to Sesame now, but this may help:

You could use DIR command.  Redirect it to a text file, then parse the file for the date at the beginning of the line.

Example:
DIR filepath\test.txt>tempfile.txt  is the line for RedirectProcess

This is the result in tempfile.txt:
Directory of C:\Documents and Settings\Bob

01/29/09  06:39 PM                67 test.txt
              1 File(s)             67 bytes
              0 Dir(s)  18,695,352,320 bytes free

The file date for text.txt is at the beginning of line 3.  So you could use RegExBetweenString or read the third line and take the left most 8 characters.  Format of the date may vary depending on your system settings.


  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Get filedate of a selected file?
Reply #2 - Jun 12th, 2009 at 4:55pm
Print Post Print Post  
If you are using RedirectProcess, you should not redirect the results to a text file. If you "catch" the results as the returned value, you can parse those rather than having to read and parse a text file.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Get filedate of a selected file?
Reply #3 - Jun 12th, 2009 at 5:12pm
Print Post Print Post  
You are right Mark.   Roll Eyes

I am still an old DOS user, hard to break those habits. Wink
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged