Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Windows do case-insensitive file names and paths? [duplicate]

On Windows, file comparisons are case insensitive operations. However, a truly case insensitive system would be sensitive to locale settings, and would have to deal with three cases, rather than two (at least, according to Unicode). For various reasons, I'd like to replicate the way Windows does this outside of Windows, if possible.

Does Windows use this kind of locale support, or does it follow a more predictable pattern (e.g. somewhat like C#'s OrdinalIgnoreCase settings)?

like image 943
Billy ONeal Avatar asked Jan 17 '12 18:01

Billy ONeal


1 Answers

As far as I know NTFS supports two modes:

  1. POSIX namespace:
    Any UTF-16 code unit (case sensitive) except U+0000 (NUL) and / (slash).

  2. Win32 namespace:
    Any UTF-16 code unit (case insensitive) except U+0000 (NUL) / (slash) \ (backslash) and some other characters like :*" etc.

In Win32 mode any program using the Win32-API converts any character of a filename to uppercase (if possible) and uses that name internally.

like image 168
Mithrandir Avatar answered Sep 25 '22 00:09

Mithrandir