[jdk17u-dev] RFR: 8316304: (fs) Add support for BasicFileAttributes.creationTime() for Linux
Stanislav Bashkyrtsev
duke at openjdk.org
Tue Aug 26 13:11:46 UTC 2025
On Fri, 26 Jan 2024 08:23:11 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
> Users already get different behaviour on say, Mac OS, Windows and Linux (with statx support) today. The former two support creationTime(), Linux does not (prior this patch).
It looks like the behavior of `BasicFileAttributes` and `BasicFileAttributeView` is now inconsistent on Linux (Apline). I can change the time using:
BasicFileAttributeView attributes = Files.getFileAttributeView(path, BasicFileAttributeView.class);
attributes.setTimes(time, time, time);
And the 3d param is called `createTime`. But apparently it sets a different attribute than what we get using:
FileTime actual = Files.readAttributes(path, BasicFileAttributes.class).creationTime();
Tried with OpenJDK 24.
-------------
PR Comment: https://git.openjdk.org/jdk17u-dev/pull/2175#issuecomment-3224103239
More information about the jdk-updates-dev
mailing list