• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Checking file version, date and time stamp created

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried looking at the java.io.File API documentation? It will answer some of your questions.
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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



If the file is not modified, lastModified() is the creation date.
 
fayzal fauzie
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic