I personally thought that NTFS was case insensitive, since you can type cmd, CMD, cMd or even CmD and still get the command prompt. However, why is it that during a CHKDSK x: /f /r
, sometimes it fixes capitalization in some files? If it didn't care about the case, it shouldn't matter about that, and CHKDSK shouldn't be checking if it's actually CMD or cmd. Am I right? Where does it actually matter in the file system?
-
27Note that "case-sensitive" and "case-preserving" are two separate things. NTFS is case-preserving but case-insensitive in the Win32 namespace, but can be case-sensitive in POSIX namespace.– grawity_u1686Commented Dec 2, 2011 at 22:09
-
I'm frustrated that none of the answers actually answered the question of "why?" I'm on a history investigation to figure out what prompted the designers of Windows to make it case-insensitive, and just getting "Well ackshually" answers like the ones below...– NeuroXcCommented Jul 15, 2023 at 5:55
3 Answers
The case sensitivity of a file system is a separate issue from that of an operating system. Latest Windows releases are based on the NT kernel, which inherits a lot of properties of the non-NT Windows 95 and even MS-DOS. Along with the NT kernel the file system, NTFS, was designed to be case sensitive -- to be POSIX compliant.
Although the Win32 subsystem does not support file names that only differ by case sensitivity, it is possible to create those files with lower level system calls.
-
1I'm not aware of an easy way to create such files in Windows. However, calling CreateFile() API with FILE_FLAG_POSIX_SEMANTICS bit should do the job programmatically.– FrankCommented Dec 2, 2011 at 23:19
-
2@Luke: Win32 does not support case sensitive files. YOu'll have to make API calls into the OS subsystem. osronline.com/article.cfm?id=91– surfasbCommented Dec 2, 2011 at 23:26
-
3@Luke: One easy way would be to mount the NTFS drive from a Linux system and create the files you wish there :)– HippoCommented Dec 3, 2011 at 4:40
-
2Just make sure that you have the right version of Windows NT and install the Subsystem for UNIX-based Applications utilities, people.– JdeBPCommented Dec 3, 2011 at 21:05
-
1
It actually isn't NTFS that you are inquiring about.
NTFS is the filesystem. Your question is really about the case-sensitivity of the Windows command shell. They're completely different. Windows Explorer is a graphical command shell. By entring cmd
(in Start | Run for example) you're telling the Windows command shell to execute the command cmd
(which itself is actually another command shell, but command line based rather than graphical).
Similarly, CHKDSK is not doing any kind of check on whether you used CMD or cmd. All CHKDSK knows about are the parameters you pass to it, which in this case are x:, /f and /r.
As for CHKDSK "fixing capitalization", I'm not really sure what you mean there.
-
4The NTFS is case-sensitive. According to MS KB article 100625: In NTFS, you can create unique file names, stored in the same directory, that differ only in case. For example, the following filenames can coexist in one directory on an NTFS volume: CASE.TXT case.txt case.TXT However, if you attempt to open one of these files in a Win32 application, such as Notepad, you would only have access to one of the files, regardless of the case of the filename you type in the Open File dialog box.– FrankCommented Dec 2, 2011 at 21:03
-
That is true, thank you for clarifying that. I've taken that bit out of my answer since it's not really what is in question here anyway. Commented Dec 2, 2011 at 21:10
-
> However, if you attempt to open one of these files in a Win32 application, such as Notepad, you would only have access to one of the files, regardless of the case of the filename you type in the Open File dialog box Which one?– SynetechCommented Dec 3, 2011 at 23:03
-
4@Synetech: The first one, perhaps? Depends on the file order in the directory, and possibly the moon phase. Commented Dec 4, 2011 at 0:10
I suspect the question asker's claim that chkdsk.exe is "fixing capitalization in some files" is actually prompted by the message from CHKDSK that occurs under some circumstances:
correcting errors in the uppercase file
Basically, this results from a Windows XP version of chkdsk.exe running against an NTFS volume that has been formatted in a later version of Windows, as described in Error message when you run Chkdsk.exe on a Windows XP-based or on a Windows Server 2003-based computer: “Correcting errors in the uppercase file”. The upshot is that this is really not an error, and has nothing to do with case sensitivity.