Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

file.lastModified() not working in MAC OS

843838Jul 11 2007 — edited Jul 17 2007
Hi all,

Iam trying to get the lastmodified time of a file using this
        File newFile=new File(uploadFilePath); //uploadFilePath has the path of the file.
        String newFile_Name=newFile.getName();
        
        long lastmodified=newFile.lastModified();
The above is working in windows but not in MAC. in MAC i get the lastmodified time as 0. I

s there anyother functionality to get this in MAC. or is it the problem with the path?.

For eg. the uploadFilePath in PC will be like this

C:\Documents and Settings\Tanuja\Desktop\File\file_management.txt
where as in MAC file path of a selected file will be like this.
/Users/Tanuja/Desktop/file_management.txt

is this path makes difference or iam i going wrong somewhere?

could not figure out.


Thanks,
Thanuja.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 14 2007
Added on Jul 11 2007
3 comments
136 views