dcsimg
How change exist file attribute , example file a.bat...
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   haonan_haonan
Posted On:   Thursday, March 15, 2001 09:09 PM

How change exist file attribute , example file a.bat is built at 2000-01-01, can I change this file attribute to 2001-01-02 ?

Re: How change exist file attribute , example file a.bat...

Posted By:   AlessandroA_Garbagnati  
Posted On:   Friday, March 30, 2001 10:10 AM

Hi,

You can easily change some file attributes of a file file using the java.io.File class. For example, if you want to change the last modification date just use something like this:

...
File file = new File("C:\autoexec.bat");
System.out.println("Last Modified = " + file.lastModified());
file.setLastModified(60000);
System.out.println("Last Modified = " + file.lastModified());
...
About | Sitemap | Contact