0

So I'm running an app on the Windows side and I want that app to access a Linux file. I see all the Linux files there at:

\\wsl.localhost\Ubuntu

But the Windows app is going to use either case for any file because it's programmed for case insensitive. It never thought it would be running on a case sensitive filesystem.

So my Windows App will find file \\wsl.localhost\Ubuntu\FooBar.txt and later attempt to access file \\wsl.localhost\Ubuntu\FOOBAR.TXT then wonder why it cannot find the file it was looking for.

The solution here didn't work: Adjust case sensitivity. And whoever wrote it was never clear about which side was trying to access which side's file for each solution. I tried the one where you set something up in wsl.conf then reboot WSL and it did NOT allow me to access \\wsl.localhost\Ubuntu\FooBar.txt by typing \\wsl.localhost\Ubuntu\FOOBAR.TXT.

Joe C
  • 662
  • I think you'll need to copy the file to Windows. – harrymc Jan 05 '24 at 20:18
  • I'll add. I tried mapping drive letter to \wsl.localhost\Ubuntu\ using subst and linking a folder to it using mklink /d. Then I did the "fsutil.exe file setCaseSensitiveInfo". Neither worked. But maybe if I map a network drive back to localhost that'll kill the case sensitivity. – Joe C Jan 05 '24 at 20:21
  • 1
    I mean copy the entire file physically to Windows NTFS and let the app get it from there, not from WSL. – harrymc Jan 05 '24 at 20:23
  • @harrymc yes I understand your suggestion but that's not what I want, hence the question. – Joe C Jan 05 '24 at 20:52
  • A Windows application shouldn't care about the case of a filename. Have the Windows application perform a string operation on the filename before it's created. – Ramhound Jan 05 '24 at 22:20
  • @Ramhound. It's not my Windows Application it's Intellisense that doesn't work. – Joe C Jan 05 '24 at 22:35
  • @JoeC - Isn’t Intellisense a feature of Visual Studio? Sounds like you should diagnose another solution since WSL2 is Linux and has all the same limitations and features. – Ramhound Jan 05 '24 at 23:36

2 Answers2

1

The article talks about making NTFS case-insensitive. You're asking for the opposite. Unfortunately, while Ext4 on Linux also supports case-insensitivity, that's not enabled in WSL at the moment.

One alternative is to use traditional SMB file sharing1, as the Samba SMB server on Linux has internal support for case-insensitivity even if the filesystem doesn't support that.

1 (\\wsl.localhost uses 9P, not SMB.)

u1686_grawity
  • 452,512
1

WSL does not support case-insensitive file-names.

The only possibility I can see is to give both names to the same file, by creating in the Ubuntu folder a symlink named FOOBAR.TXT that points to FooBar.txt, so both names exist and refer to the same file.

harrymc
  • 480,290
  • You can use string manipulation within whatever language is creating the file, to make the name of the file, all uppercase or all lowercase. – Ramhound Jan 05 '24 at 22:19
  • Yeah I'm actually trying to use MS Visual Studio's Intellisense which uses all capital letters as described here. https://developercommunity.visualstudio.com/t/Intellisense-does-not-work-with-case-sen/1670489?space=8&q=distributing#:~:text=Intellisense forces the filesystem paths,no Intellisense assist at all. – Joe C Jan 05 '24 at 22:34