Is there a way to obtain the file attributes (specifically, the file key) of an already-open file channel? This operation would be similar to the POSIX fstat
function.
If I know a path of the file, I can call Files.readAttributes(…)
, but this still has a race condition on systems where open files can be deleted or renamed. I do not see a way to avoid this race condition, so something else would be needed.