Case preservation


In file systems, case preservation is the preservation of the letter case of letters in file names. If an attempt is made to create a file named "ThisIsAFile" on a file system that preserves letter case, the file's name will be "ThisIsAFile", rather than, for example, "thisisafile" or "THISISAFILE".
In contrast, a file system that does not preserve letter case will typically store letters in file names either as all lowercase or as all uppercase, and the letter case information will thus be lost. If an attempt is made to create a file named "ThisIsAFile" on a file system that does not preserve letter case, the file's name will be "thisisafile" if letters are stored as all lowercase or "THISISAFILE" if letters are stored as all uppercase.

Combinations of preservation and sensitivity

Case-preserving, case-insensitive

It is possible and common for a system to be case-insensitive, yet case-preserving. This combination is often considered most natural for people to understand, because most people prefer using the correct capitalization but will still recognize others. For example, a reference to the "uNiTeD states oF AMERICA" is understood to mean the United States of America, even though the capitalization is incorrect.
Most of the file systems in macOS, current versions of Microsoft Windows, and all versions of Amiga OS are case-preserving and case-insensitive. Since they are case-insensitive, any combination of lowercase or uppercase letters can be used when referring a file, so that a file named "ThisIsAFile" can be referred to as "thisisafile", "THISISAFILE", "thisISaFILE", and so on. However, since they are case-preserving, when a file is created, the file name will be stored in the combination of lower and upper case letters specified, so that if a file is created as "ThisIsAFile", the name of the file will be "ThisIsAFile" rather than, for example, "thisisafile" or "THISISAFILE".
This means that one cannot save two files with the same name in the same place if the only difference in their file names is capitalization. For example, one cannot have files named readme.txt and README.TXT in the same folder.

Non-case-preserving, case-insensitive

A system that is non-case-preserving is necessarily also case-insensitive.
This applies, for example, to Identifiers in some relational databases, unless the identifier is specified within double quotation marks.
In a non-case-preserving system, arbitrary capitalization may be used by the system for storage and display, such as for example all letters being store in lowercase. For example, in Oracle Database, a table created with the name CustomersRegion1 will be stored as CUSTOMERSREGION1.

Case-sensitive (results in case-preservation)

Most of the file systems in Unix-like systems other than macOS, such as file systems in Linux, are case-sensitive. This means that there can be two files in the same folder whose only difference is capitalization. For example, readme.txt and README.TXT can be found in the same folder.

Examples of file systems

Some examples of file systems with various case-sensitivity and case-preservation are:
Case-sensitiveCase-insensitive
Case-preservingUFS, ext3, ext4, HFS Plus, NTFS, APFS VFAT, FAT32 which is basically always used with long filename support, NTFS, HFS Plus, APFS
Non-case-preservingImpossibleFAT12, FAT16 only when without long filename support