Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4122085
Votes 19
Synopsis File.{access,creation,modification}Date() to examine file time information
Category java:classes_io
Reported Against 1.3 , 1.0.1 , 1.3.1 , 1.4.1 , 1.2beta2 , merlin-beta2
Release Fixed
State 11-Closed, duplicate of 4313887, request for enhancement
Priority: 5-Very Low
Related Bugs 4084666 , 4515133 , 4313887
Submit Date 23-MAR-1998
Description


I need to find out the creation date of a file.
The class File has only the methode 
lastModified()

What about the following methods?
getCreationDate()
getModificationDate()
getAccessDate()
(Review ID: 26451)
======================================================================
Posted Date : 2005-08-25 16:20:09.0
Work Around
N/A
Evaluation
In order to add these we must first ascertain that they all make sense across
all platforms -- which seems unlikely.  --   xxxxx@xxxxx   3/23/1998
This feature has been addressed by the new file system API defined by JSR-203.
Posted Date : 2009-02-16 13:37:00.0
Comments
  
  Include a link with my name & email   

Submitted On 27-APR-1998
Taquinho
I just need to find some description of the format that the lastModified()
method returns to me, on all the most used platforms ... where can I get this ?


Submitted On 02-JUN-1998
zaz
My main desire in wanting this resolved is to have
at least the lastModified() method return a normal
Java date/timestamp, i.e. similar to System.currentTimeMillis()
or better yet a Date or Calendar object.
The other time/date attributes associated with a file would
be nice to complete the attribute list normally associated
with a file.  It could also be argued that is is unlikely
that all platforms even support the concept of "last modified."


Submitted On 27-JUL-1998
wert
of course they make sense on all platforms.
if you only do stuff that *can be implemented*
on all platforms then you throw out a lot of
good stuff. some platforms are just deficient.
suggest you define that return 0 (long) or null
(Date) means "not implemented" then implement
where you can.


Submitted On 23-MAR-1999
pspurr
Finding out the creation date is supported on most OSes, if we boil everything
down to the lowest common denominator we won't have anything left.
I would rank this as a strong contender for the next release, don't forget the
ability to also set these. If you can get something you should be able to set
it.


Submitted On 02-AUG-2001
andre_nicolai
missing also other attributes like System and Archive
andre_nicolai@hotmail.com


Submitted On 10-JUN-2003
mzaleski-ford
I've posted a Win32 JNI work-around in the Java forums:
http://forum.java.sun.com/thread.jsp?
forum=31&thread=409921&start=0&range=100#1800193


Submitted On 24-SEP-2006
Note that a working patch has been provided to implement getLastAccessed() in bug 6314708. 

The evaluation's argument is specious. There is nothing to prevent the specification for these methods saying "will return 0L where the underlying native filesystem does not provide this information".  Other parts of the Java API use UnsupportedOperationException to communicate this, but in the case of this information, returning 0 is perfectly acceptable.  [(mail address withheld) Colm Smyth, http://colmsmyth.blogspot.com]



PLEASE NOTE: JDK6 is formerly known as Project Mustang