Case sensitive file extensions in Windows and Linux

In linux you can have the files example.JPG and example.jpg in the same directory.

In Windows you have case sensitive extensions, but you can't put these two files in the same directory. Why not?


In Windows you have case sensitive extensions, but you can't put these two files in the same directory. Why not?

If a drive is formatted as NTFS you can have both example.JPG and example.jpg.

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.


Filenames are Case Sensitive on NTFS Volumes

As part of the requirements for POSIX compliance, the Windows NT File System (NTFS) provides a case-sensitive file and directory naming convention. Even though NTFS and the POSIX subsystem each handle case-sensitivity well, 16-bit Windows-based, MS-DOS-based, OS/2-based, and Win32-based applications do not.

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.

...

NTFS supports two slightly different modes of operation that can be selected by the subsystem of the application interacting with NTFS. The first is fully case sensitive and demands that file names supplied by the application match the names stored on disk including case if the file on disk is to be selected. The second mode of operation is case preserving but not case sensitive. This means that applications can select files on the disk even if the supplied name differs in case from the name stored on the disk. Note that both modes preserve the case used to create the files. The difference in behavior noted here applies only when an application needs to locate an existing file. POSIX takes advantage of the full case sensitive mode, while MS-DOS, WOW, and Win32 subsystems use the case insensitive mode.

Source Filenames are Case Sensitive on NTFS Volumes:


In practice, I wasn't able to accomplish this

To achieve two files in the same directory differing only by case you need to enable the Posix subsystem.

POSIX takes advantage of the full case sensitive mode, while MS-DOS, WOW, and Win32 subsystems use the case insensitive mode.

To enable Posix see:

  • Making Windows 7 Ultimate POSIX-compatible
  • Where does Microsoft Windows' 7 POSIX implementation currently stand?

NTFS is Case Sensitive (& depending on how you view the glass , it might be a good thing or a bad thing). In reality, achieving Case Insensitivity was a challenge in the early days since you had to NOT differentiate between ASCII values for a-z & A-Z .

There is no way to make Windows (the OS) case sensitive even though NTFS (the File System) used by Windows OS's these days can support in order to comply with POSIX.

According to Microsoft you could have example.JPG and example.jpg in the same directory on NTFS (click here), but the OS (All Versions of Windows) does not support it which makes the fact the File System can pointless :)

As part of the requirements for POSIX compliance, the Windows NT File System (NTFS) provides a case-sensitive file and directory naming convention. Even though NTFS and the POSIX subsystem each handle case-sensitivity well, 16-bit Windows-based, MS-DOS-based, OS/2-based, and Win32-based applications do not.