[jdk17u-dev] RFR: 8316304: (fs) Add support for BasicFileAttributes.creationTime() for Linux
Thomas Stuefe
stuefe at openjdk.org
Fri Jan 26 08:25:33 UTC 2024
On Thu, 25 Jan 2024 16:22:03 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
> Thanks for the review!
>
> > I wonder about backward compatibility - whether there is code that relies on creation time being the modification time. If so, its an error of course, but still may cause problems.
>
> 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). The [javadoc](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/nio/file/attribute/BasicFileAttributes.html#creationTime()) from creationTime() mentions:
>
> ```
> If the file system implementation does not support a time stamp to indicate the time when the file was
> created then this method returns an implementation specific default value, typically the last-modified-time
> or a FileTime representing the epoch (1970-01-01T00:00:00Z).
> ```
>
> So there is no change there. Even on some Linux systems where `statx` isn't supported you'd get the old behaviour. This is according to spec.
Okay. In the end, you are the maintainer, so if the risk is acceptable to you it is to me too.
-------------
PR Comment: https://git.openjdk.org/jdk17u-dev/pull/2175#issuecomment-1911656123
More information about the jdk-updates-dev
mailing list