Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to return millisecond information for File Access on Mac Os X (in Java)?

I just recognized that Mac Os X does not return any millisecond information to java.io.File#lastModified() method.

The long values are rounded, so the most specific kind of information is the second after transfer to a DateTime Object.

Is there a way to get those information some other way, maybe through the java.nio.file.Files#readAttributes(Path,Class,LinkOption[]) method, or want it be possible to distinguish between milliseconds?

like image 244
Macilias Avatar asked Aug 23 '13 13:08

Macilias


1 Answers

This is a limitation of the file system, not of the Java API. According to the format specification HFS+ only stores timestamps to a granularity of one second.

like image 93
Ian Roberts Avatar answered Sep 25 '22 03:09

Ian Roberts