RFR: 8343417: (fs) BasicFileAttributeView.setTimes uses microsecond precision with NOFOLLOW_LINKS [v3]
Alan Bateman
alanb at openjdk.org
Wed Nov 6 09:20:31 UTC 2024
On Wed, 6 Nov 2024 01:31:20 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
>> Add support for setting the last access and last modification times of symbolic links with nanosecond precision on Linux where the system call `utimensat(2)` is available.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>
> 8343417: Use utimensat or lutimes when not following links
I think what you have is correct now but it's hard to follow as it's one of 4 sys calls. What would you think about use a local enum class and a switch and get rid of the 4 booleans. Alternatively, invert the setup so that if the follow case is first. The follow case should map to fd+futimens or utimes, no need for futimes. For the !follow case then it should map to lutimesnsat or lutimes. I realise this is adding to the work on this change but right now it's hard for anyone to touch this method due to the many cases.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/21886#issuecomment-2459090106
More information about the nio-dev
mailing list