问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/18403588/how-to-return-millisecond-information-for-file-access-on-mac-os-x-in-java