[Tutor] Case Insensitive Globing
Steven D'Aprano
steve at pearwood.info
Sat May 18 20:37:56 EDT 2019
On Sat, May 18, 2019 at 11:52:29AM +0100, Alan Gauld via Tutor wrote:
> On 18/05/2019 03:14, Richard Damon wrote:
>
> > The same directory, running the same program under Mac OS X, which also
> > is a case insensitive file system,
>
> That is your mistake. Darwin, the core of the MacOS X system
> is a version of BSD Unix and like all Unix OS is very much
> case sensitive.
That's not quite right -- case sensitivity of the OS isn't important,
case sensitivity of the *file system* is. And the standard file system
on Mac OS, HFS+, defaults to case-preserving but case-insensitive.
(There is an option to turn case-sensitivity off, but hardly anyone uses
it because too many applications break.)
https://stackoverflow.com/questions/4706215/mac-os-x-how-to-determine-if-filesystem-is-case-sensitive
https://apple.stackexchange.com/questions/71357/how-to-check-if-my-hd-is-case-sensitive-or-not
That means that, like Windows file systems FAT and NTFS, file names are
case-insensitive: files "Foo", "foo" and "FOO" are all considered the
same. But unlike Windows, the file system preserves the case of the file
as you created it, so if you created it as "foO" that's how it will be
recorded on the disk rather than normalizied to "foo".
Fun fact: even NTFS supports a case-sensitive mode! But again, hardly
anyone uses it. Likewise, if you are using Samba on Unix/Linux, you can
have case-insensitive file operations on an underlying case-sensitive
file system.
> Some of the GUI tools in MacOS X may work as if they were case
> insensitive (presumably for backwards compatibility to MacOS 9)
> but the underlying OS is case sensitive and all the Terminal
> type tools and commands, including Python, follow suit.
I don't think that is correct:
https://apple.stackexchange.com/questions/22297/is-bash-in-osx-case-insensitive
--
Steven
More information about the Tutor
mailing list