-
CSR
-
Resolution: Unresolved
-
P4
-
None
-
behavioral
-
minimal
-
BasicFileAttributes.creationTime() is reverted to its longstanding behavior.
-
Java API
-
SE
Summary
On Linux, prior to the change made for JDK-8316304, the file creation time provided by java.nio.file.attribute.BasicFileAttributes.creationTime()
returned the last modified time of the file as retrieving the creation time from the underlying system was not supported. The change for JDK-8316304 added use of the Linux statx(2)
system call to retrieve the birth time, i.e., creation time, of the file. If however the birth time is not actually filled in, the creation time is set to zero (0
), which denotes the epoch (1970-01-01T00:00:00Z). This is an incompatible change as previously the last modified time, not zero, had been returned.
Problem
Retrieving the file birth time requires support of the statx(2)
system call, and support for the birth time by the file system in question. If the file system does not support the birth time, then the stx_mask
member of struct statx
does not have the STATX_BTIME
bit set. In the change for JDK-8316304, this mask was not checked and the stx_btime
member was always used. When the file system did not support the birth time, stx_btime
was zero.
Solution
Back out the change in the appropriate older releases.
Specification
There are no normative changes.
- csr of
-
JDK-8338879 Revert the fix for 8316304
-
- Resolved
-
- links to