IntelliJ Java IDE
The moose likes I/O and Streams and the fly likes How to get the Date of creation of a File[very.... Urgent....] Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Reply Bookmark "How to get the Date of creation of a File[very.... Urgent....]" Watch "How to get the Date of creation of a File[very.... Urgent....]" New topic
Author

How to get the Date of creation of a File[very.... Urgent....]

netharam ram
Ranch Hand

Joined: Aug 09, 2001
Posts: 202
Hi, I want to display the date of creation of a File.I get the last accessed date from the lastModified()method ,but I want the file creation Date.Please reply me as soon as possible.
Happy middling with java
Netharam
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
if the file hasnt been modified since its creation date then it will return you the creation date.
as far as i know, if u modify the file then the cretaion date changes to the new modification.
same as in dos.
(but then again i may be wrong)
netharam ram
Ranch Hand

Joined: Aug 09, 2001
Posts: 202
sorry U have misunderstood my post.You might have noticed in Windows,when u right click on a file & view its properties it displays the file's creation date,last Modified Date & last accessed date.Similarly I want the file creation Date.
Netharam
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
ok
did a little net searching and the answer i got is u CANT!
the reason for this is that now all platforms (including all kind of windows) have this information.
java need to support all platforms , so u cant do it.
u can try use JNI to access it.
 
 
subject: How to get the Date of creation of a File[very.... Urgent....]
 
Threads others viewed
how to get file created date in Java?
How to delete files in a directory older than n days
sort an array
File Creation Date using JNI
Directory creation date
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com