aspose file tools*
The moose likes I/O and Streams and the fly likes Checking file version, date and time stamp created Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Checking file version, date and time stamp created " Watch "Checking file version, date and time stamp created " New topic
Author

Checking file version, date and time stamp created

fayzal fauzie
Greenhorn

Joined: Mar 11, 2010
Posts: 4
I am thinking of a way if possible ? to write a program in java
to check particular files in particular directory in windows of above mentioned attributes -
the version of the file
the date it was created
the time it was created

these are mainly txt, bat for the time stamp check
and exe, dll for time stamp and its version

Is this platform specific stuff or i can make use a particular API, from java or any other API

any pointer is very much helpful ...

Thanks in advance
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8911
    
    8

Have you tried looking at the java.io.File API documentation? It will answer some of your questions.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19697
    
  20

Actually it doesn't. File creation date/time isn't available, and neither is version. You'll have to go native, possibly using an existing library.
Should you choose to go native, be warned: Windows timestamps are not in milliseconds since January 1st 1970 at 0:00:00 but in numbers of 100 nanoseconds since January 1st 1601 at 0:00:00 (CET).


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8911
    
    8

Rob Prime wrote: File creation date/time isn't available,
.


If the file is not modified, lastModified() is the creation date.
fayzal fauzie
Greenhorn

Joined: Mar 11, 2010
Posts: 4
Hey Rob and Joe,

Thank you very much. Yes this indeed more than meets the eye .. and yea these files is not modified ( by right )...so one thing is solved.
Going native is not an option for theres 100 odd workstations i need to check these against and java only seems to be the only common thing
these workstations has currently.

Still opens for any suggestion.

Thanks
fayzal fauzie
Greenhorn

Joined: Mar 11, 2010
Posts: 4
Just show my appreciation to Rob and Joe,

I have opted to do this manually students are helpful these days ..

Thanks again for quick response.
 
Don't get me started about those stupid light bulbs.
 
subject: Checking file version, date and time stamp created