RFR: 8298187: (fs) BsdFileAttributeViews::setTimes does not support lastAccessTime on HFS+
Brian Burkhalter
bpb at openjdk.org
Thu Dec 8 19:22:52 UTC 2022
On Thu, 8 Dec 2022 19:13:03 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
> If the path is on an HFS store, use the generic Unix implementation of `java.nio.file.attribute.BasicFileAttributeView::setTimes`to set the last access time.
The macOS system call `setattrlist(2)` fails to set the last access time supplied as a parameter when the file in question is on an HFS store. It appears to override the parameter value with the current system time at the moment the system call is invoked.
The portion of the proposed change starting at line 42 handles the common case where the creation time is _not_ being set. The other more substantial changes further down handle the likely uncommon case where the creation time _is_ being set.
-------------
PR: https://git.openjdk.org/jdk/pull/11600
More information about the nio-dev
mailing list