Last updated 2004-06-28 by Roedy
Green ©1996-2004 Canadian Mind Products
Java definitions: 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
You are here : home : Java Glossary : L words : Last Modified Date.
With Java 1.4 you can now set the date as well with File.setLastModified ( long timestamp )
I have written native code for windows that lets you set three of the file dates. Email me if you are interested.
import com.mindprod.untouch; /** * Set TimeStamps on a file. * * @param filename Name of file to change dates on. * @param whenFileCreated * timestamp milliseconds since 1970 GMT. * Date the file was created. * 0 means leave as is. * @param whenFileLastAccessed * timestamp milliseconds since 1970 GMT. * Date the file was last read. * 0 means leave as is. * * @param whenFileLastUpdated * timestamp milliseconds since 1970 GMT. * Date the file was last written. * 0 means leave as is. * * @return return true if all went ok */ public static boolean setFileTimes ( String filename , long whenFileCreated, long whenFileLastAccessed , long whenFileLastUpdated );
You can examine the date with File.lastModified() and set it in Java 1.4+ with File.setLastModified()
home |
Canadian Mind Products | |||
| mindprod.com IP:[24.87.56.253] | ||||
| Your IP:[80.134.30.163] | ||||
| You are visitor number 2915. | ||||
| Please send errors, omissions and suggestions | ||||
| to improve this page to Roedy Green. | ||||
| You can get a fresh copy of this page from: | or possibly from your local J: drive mirror: | |||
| http://mindprod.com/jgloss/lastmodified.html | J:\mindprod\jgloss\lastmodified.html | |||