java/nio/file/Files/CopyAndMove.java is failing

Bernd Eckenfels ecki at zusammenkunft.net
Tue Mar 12 09:38:51 UTC 2019


Hello,

Note also that there is a NTFS flag which makes it case sensitive. And this is since 1804 even on a per folder base. What’s worse is that the flag is per default set for Linux for Windows Files. And also the posix Flag for CreateFile enables this (which needs to be observed if you want to use it for delete)

Maybe it would be better to keep compare case sensitive (if you do not want to implement fe specific config) and instead make sure the reported roots are canonicalized from the filesystem?

Gruss
Bernd
--
http://bernd.eckenfels.net

________________________________
Von: nio-dev <nio-dev-bounces at openjdk.java.net> im Auftrag von Alan Bateman <alan.bateman at oracle.com>
Gesendet: Dienstag, März 12, 2019 10:28 AM
An: Lindenmaier, Goetz; Roger Riggs; nio-dev at openjdk.java.net
Betreff: Re: java/nio/file/Files/CopyAndMove.java is failing

On 12/03/2019 08:21, Lindenmaier, Goetz wrote:
> Hi Roger,
>
> yes, it works with a capital 'C'.
>
> Should the constructor do
> this.root = root.toLowerCase()?
>
> Or should the equals method do
> root.toLowerCase().equals(other.root.toLowerCase())?
Well spotted by Roger, it seems we have a long standing bug here. As
regards fixing this when we can re-purpose the existing bug or create a
new one. toLowerCase is locale sensitive, it's more likely that it
should be equalsIgnoreCase but I think needs a bit of study to ensure
that this is correct for cases such as when the root directory is a UNC
server.

-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190312/26705c0f/attachment-0001.html>


More information about the nio-dev mailing list