[EXTERNAL] Re: Bug in Files.isSameFile(Path,Path)
Nikola Grcevski
Nikola.Grcevski at microsoft.com
Thu Oct 29 15:23:49 UTC 2020
Hi Alan,
We are still trying to get to the bottom of this, it seems like Microsoft documented the API non-zero is safe to use behaviour for Python (https://github.com/python/cpython/pull/5764/files), but it's not there in MSDN. We are waiting to hear back on our internal developer support channel from the API owners.
Cheers,
Nikola
-----Original Message-----
From: Alan Bateman <Alan.Bateman at oracle.com>
Sent: October 29, 2020 10:38 AM
To: Nhat Nguyen <honguye at microsoft.com>; Nikola Grcevski <Nikola.Grcevski at microsoft.com>; WarnerJan Veldhuis <veldhuis at freedom.nl>; nio-dev at openjdk.java.net
Subject: Re: [EXTERNAL] Re: Bug in Files.isSameFile(Path,Path)
On 29/10/2020 00:13, Nhat Nguyen wrote:
> Hi everyone,
>
> We looked into the issue and found that the values of volSerialNumber,
> fileIndexHigh, and fileIndexLow in the file attributes, which are used
> to determine if the two files are the same, are all zeroes when used
> with webdav drives. However, this looks like a known issue as cpython seems to suffer from the same behaviour as well [1].
>
> We have a suggested fix [2] that falls back to using
> GetFinalPathByHandle and comparing the two paths when the
> volSerialNumber is zero. We have also reached out to the Windows team to confirm if this is the preferred way to detect such cases; we will get back when we have hear back from them.
>
> [1]:
> https://github.com/python/cpython/pull/5764#discussion_r169221544
> [2]:
> https://github.com/nhat-nguyen/jdk/commit/bd8fdc2809ed08e5564fe1eab4a7c1c2f32df84b
>
Thanks for looking into it. Do you know if the serial number = 0 is documented anywhere?
I have a number of comments on how this workaround should fit in, I'll reply soon on this.
-Alan.
More information about the nio-dev
mailing list