RFR: 8338696: (fs) BasicFileAttributes.creationTime() falls back to epoch if birth time is unavailable (Linux)

Brian Burkhalter bpb at openjdk.org
Tue Aug 20 21:32:03 UTC 2024


On Tue, 20 Aug 2024 21:21:10 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> Set the value returned by `BasicFileAttributes.creationTime()` on Linux to the birth time, if available, otherwise return the last modified time.

The PR #15792 that resolved [JDK-8316304](https://bugs.openjdk.org/browse/JDK-8316304) changed the creation  time to be set to the birth time retrieved by the `statx(2)` system call, if that call is available, but failed to check the `stx_mask` field of the returned `struct statx` structure to see whether the `STATX_BTIME` bit had been set, indicating that the birth time had been filled in. This is a behavioral change from prior versions. Also, the deprecated constant `STATX_ALL` was used.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/20655#issuecomment-2299797746


More information about the nio-dev mailing list