Skip to content

Case sensitivity policy now means WSL creates cursed files and directories #3356

@mcclure

Description

@mcclure

My primary use case for WSL is to have access to UNIX convenience utilities, such as git and mercurial, while doing Windows development. Today I cloned a repository containing a Unity project to my Windows home directory (/c/mnt from WSL's perspective) using "hg clone" in WSL.

Unity printed this utterly strange error:

image

I did not see this error before the Windows 10 and WSL system updates delivered this week.

I checked Google and found this blog post:

https://blogs.msdn.microsoft.com/commandline/2018/02/28/per-directory-case-sensitivity-and-wsl/

It appears WSL is now by default creating directories with some sort of strange special property which causes those directories to be case-sensitive. The blog post claims that you can use "fsutil.exe file setCaseSensitiveInfo [path] disable" to reverse the curse, but when I attempt this I get "Error: The directory is not empty."

I think that this is a very user-unfriendly behavior. Before, WSL nicely interoperated with Windows files and applications. Now WSL has suddenly started silently peppering drives with files with a strange Linux nature which can and does break "normal" Windows applications. This special nature cannot be detected without the use of obscure command line utilities, and it does not appear to be possible (assuming a populated directory tree of cursed files) to reverse it.

My expected behavior, and how WSL seems (???) to have worked before this week, is that files in the "Linux partition" (/) have Linux behaviors, and files in the "Windows partition" (/mnt/c) have Windows behaviors. I think that a better default would be that files in / should default to case=on and files in /mnt/c should default to case=off. Someone who really needs to create case-sensitive files on the Windows partition can locate the blog post and change more easily than someone who just wants to make files Windows applications can read.

A comment attached to the blog post explains that wsl.conf can be used to set case=off globally, but there are two problems. First off, I am not clear whether this is what I want. If I set case=off in wsl.conf, does that mean I will be creating case-insensitive in the "linux partition" (/ not /mnt/c/?). The blog post, if it is to be the only documentation of this feature, should be clearer (the blog post says "use wsl.conf" but leaves it to a comment to explain how, and has a long diversion about "DrvFs" at the end but does not explain what DrvFs is). Second off, it appears wsl.conf requires rebooting the whole computer to take effect. A further expected behavior is that it should be possible to change the default directory case property on the fly, or for a single process or session, the same way I can call "umask" to change the default permissions for files. (If the default were non-disruptive I would care less about this though.)

My Windows build number is Microsoft Windows [Version 10.0.17134.137]. My apt-get upgrade on the WSL/Ubuntu side is up to date.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions