Why is directory.exist case insensitive? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why is directory.exist case insensitive?

At around 18:30 of https://youtu.be/9mUuJIKq40M , Tim proves a point that Directory.Exists(@"...SubFoldera"); is case insensitive at this point. Why is that? Is it due to C#, the file system, or a combination of the two? Microsoft even says it is case insensitive, but doesn't explain why in the following page: https://docs.microsoft.com/en-us/dotnet/api/system.io.directory.exists?view=netframework-4.8

4th Feb 2020, 10:37 AM
Michael Doyle
Michael Doyle - avatar
3 Answers
+ 1
It is case insensitive rather because of windows. E.g. you cannot make 2 files/folders with the same name in different case.
4th Feb 2020, 11:07 AM
Stephan
Stephan - avatar
+ 1
Wikipedia tells that NTFS is case sensitive, so case insensitivity is in OS's core
4th Feb 2020, 11:35 AM
Stephan
Stephan - avatar
0
What aspect of Windows allows for this? I doubt it is NTFS or File Explorer. Maybe the .NET framework?
4th Feb 2020, 11:28 AM
Michael Doyle
Michael Doyle - avatar