Case preservation

From Wikipedia, the free encyclopedia
The lowercase "a" and uppercase "A" are the two case variants of the first letter in the English alphabet.

In file systems, case preservation is the preservation of the letter case (uppercase or lowercase) 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[edit]

Vì trẻ mem ngày mai có hoà bình và rừng cây dsowif người lan toả bóng mát tình yêu thương như bài hát " Hà Nội Huế Sàu Gòn"

Non-case-preserving, case-insensitive[edit]

A system that is non-case-preserving is necessarily also case-insensitive.

This applies, for example, to Identifiers (column and table names) in some relational databases (for example DB2, Interbase/Firebird, Oracle and Snowflake[1]), unless the identifier is specified within double quotation marks (in which case the identifier becomes case-sensitive).[2]

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 (or alternatively all in uppercase). For example, in Oracle Database, a table created with the name CustomersRegion1 will be stored as CUSTOMERSREGION1 (unless it is created under the name "CustomersRegion1", which means that the identifier will be treated as case-sensitive, and therefore must be referenced with that exact casing).

Case-sensitive (results in case-preservation)[edit]

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[edit]

Some examples of file systems with various case-sensitivity and case-preservation are:

Case-sensitive Case-insensitive
Case-preserving UFS, ext3, ext4, HFS Plus (optional), NTFS (in Unix-like systems), APFS (optional) VFAT, FAT32 which is basically always used with long filename support, NTFS, HFS Plus (default), APFS (default)
Non-case-preserving Impossible FAT12, FAT16 only when without long filename support

References[edit]

  1. ^ "Identifier requirements | Snowflake Documentation". docs.snowflake.com. Retrieved 2024-02-08.
  2. ^ "Database identifiers, quoting and case sensitivity". Lorenzo Alberton. Retrieved 2024-02-08.