Implement WindowsFileAttributes#fileKey
Alan Bateman
Alan.Bateman at oracle.com
Thu Apr 6 13:33:35 UTC 2023
On 06/04/2023 14:03, Fabian Meumertzheim wrote:
> Hi,
>
> The build system Bazel would benefit from having a non-trivial
> implementation of WindowsFileAttributes#fileKey available - the
> function currently always returns null, even if
> sun.nio.fs.ensureAccurateMetadata is set to true.
>
> Based on my understanding of the API contract, changing this function
> to return an object with information equivalent to what is encoded in
> src/java.base/windows/classes/sun/nio/ch/FileKey.java, but only if the
> WindowsFileAttributes were created via fromFileInformation, would be a
> backwards compatible change.
>
I have a vague memory that there were issues with the volume serial
number and file ID being problematic in some environment (issues with
uniqueness and/or the file ID changing over time). The usage in the
FileLock code is very limited. An up to date survey on the stability
and feasibility of the vol serial number and file ID could be useful.
-Alan
More information about the nio-dev
mailing list