Withdrawn: 8190546: File.toPath() reject directory names with trailing space

duke duke at openjdk.org
Thu Jul 14 23:53:05 UTC 2022


On Thu, 19 May 2022 13:11:11 GMT, Maxim Kartashev <mkartashev at openjdk.org> wrote:

> [JDK-8190546](https://bugs.openjdk.java.net/browse/JDK-8190546) is currently closed as will-not-fix with a reference to Win32 documentation [1] that kind of discourages the use of space at the very end of a file name. That documentation says the following:
> 
>> Do not end a file or directory name with a space or a period. Although the underlying file system may support such names, the Windows shell and user interface does not
> 
> 
> Indeed, it's hard or even impossible to create such a file using the "normal" windows GUI, but you can use that GUI to _delete_ such a file. In Java, you can't do either. 
> 
> I'm proposing to lift this restriction primarily based on our user's requests and one or two use cases that seem legitimate.
> 
> Working in a cygwin terminal, you can fairly easily create a file name ending with a space. And when you turn to your Java-based IDE to delete it, you get an error from the very basic level of NIO that you can't overrule, which seems to be quite unfortunate. Another source of files legitimately ending with a space would be any Unix filesystem accessed from a Windows Java application (be that a local `\\wsl$` or a NFS mounted from a remote machine). 
> 
> If you are interested in moving forward with the issue, please review the PR. Thank you!
> 
> References
> [1] https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions

This pull request has been closed without being integrated.

-------------

PR: https://git.openjdk.org/jdk/pull/8788


More information about the nio-dev mailing list