The Artima Developer Community
Sponsored Link

Java Answers Forum
creation date of a file - urgent

2 replies on 1 page. Most recent reply: Mar 14, 2002 12:03 PM by Matt Gerrans

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
sonata

Posts: 3
Nickname: s20
Registered: Mar, 2002

creation date of a file - urgent Posted: Mar 14, 2002 1:20 AM
Reply to this message Reply
Advertisement
I would like to know whether there is any method to find the creation date of a file as there is for last modified date in java


Charles Bell

Posts: 519
Nickname: charles
Registered: Feb, 2002

Re: creation date of a file - urgent Posted: Mar 14, 2002 8:47 AM
Reply to this message Reply
No because that would be platform specific.
All platforms support file-modification times to the nearest second.

public long lastModified()
Returns the time that the file denoted by this abstract pathname was last modified.


public boolean setLastModified(long time)
Sets the last-modified time of the file or directory named by this abstract pathname

Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: creation date of a file - urgent Posted: Mar 14, 2002 12:03 PM
Reply to this message Reply
So, if you are working on a specific platform only (probably Windows, in this case), then the thing you can do is write native nethods (JNI) to get this platform-specific information when you are on that platform. JNI would allow you to access the FindFirstFile() Win32 API function, which will give you the WIN32_FIND_DATA that has the information you seek.

Flat View: This topic has 2 replies on 1 page
Topic: 1 thing missing in car animation Previous Topic   Next Topic Topic: How to call JSP from java code?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use