8181493: (fs) Files.readAttributes(path, BasicFileAttributes.class) should preserve nano second time stamps
brian.burkhalter at oracle.com
Wed Jul 10 20:39:59 UTC 2019
This patch would change:
1) UnixFileAttributeViews.setTimes() to set the access and modification times of a file or directory with nanosecond precision if the system call futimens()  is available, and
2) UnixFileAttributes to initialize the creation, last access, and last modifications FileTimes with nanosecond precision.
New methods to support setting the nanosecond resolution access and modification times using futimens() are added to UnixNativeDispatcher. Note that unlike futimes() and lutimes(), futimens() is *not* guaranteed to be present for the _ALLBDS_SOURCE case and so it is looked up using dlsym().
A new test is added to run on Linux, macOS, and Solaris only. On macOS if the file system is HFS+, then the test exits without failing as HFS+ supports a file stamp resolution of only one second. If the macOS file system is APFS, then the test runs through to completion.
Note that setting the creation time as requested in  appears problematic and unevenly supported on these Unix variants.
 https://pubs.opengroup.org/onlinepubs/9699919799/functions/futimens.html <https://pubs.opengroup.org/onlinepubs/9699919799/functions/futimens.html>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nio-dev