2

I have an empty directory called "foo". I try to create a new directory called "Foo". But I cannot create it:

***@###:~/test$ mkdir foo
***@###:~/test$ ls
foo
***@###:~/test$ mkdir Foo
mkdir: Foo: File exists
***@###:~/test$ ls
foo

The same behaviour can be seen for files as well.

On Linux, 2 files/folders with a difference in case can coexist in the same directory.

Why did MacOS chose to not allow case differentiation for files and directories?

3
  • 2
    macOS does allow for case sensitive file systems but I am guessing you do not have your disk formatted as case sensitive. You can verify this in Disk Utility. Aug 20, 2018 at 12:25
  • @unknowndomain You're right! It's written "Case sensitive: No" in the Disk Utility Infos. Is there a good reason for making a disk formatted as case insensitive?
    – vvvvv
    Aug 20, 2018 at 12:33
  • @vinzee The reason it is the default Apple way (also Windows) and there are several programs that do not work on case sensitive file systems
    – mmmmmm
    Aug 20, 2018 at 13:12

1 Answer 1

4

History. Backwards compatibility. Customer preference.

Historical Apple, and other, filesystems were not always case-sensitive. HFS+ and now APFS have such capability. That is, they can be case sensitive or insensitive, depending on how it was formatted.

If you are using macOS to manipulate file and folders on a case-insensitive file system macOS will prevent creating same-named files even though their displayed names can include both cases.

Experiment by plugging in flash drives formatted in different filesystems (FAT, ext3, etc) to easily test this behavior.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .