logoalt Hacker News

Kwpolskatoday at 3:00 PM1 replyview on HN

But they do see / or : in file names, and the interesting question is which one it is today on which filesystem.


Replies

syncsynchalttoday at 3:51 PM

The filesystems of macOS are particularly opinionated, much more than most Unices which tend toward "anything is allowed [and usually preserved] except \0 and /".

macOS supports case-insensitivity[0] and performs unicode normalization[1] on filenames, and decomposes name data to an extent that the question "what does the fs see" is a bit moot.

With that said, the internal storage of filenames in APFS are a nul-terminated UTF-8 string[2], with (i'm pretty sure) colons as colons, which the Finder displays as slashes.

[0] if you make a file named "Makefile" then touch a file named "makefile", it'll touch the first file, instead of making a second file.

[1] if you make a file named "schön" (s-c-h-combining¨-o-n) and then search for (s-c-h-ö-n), you can find it, or vice versa. The particular normalization/canonicalization used is NFD.

[2] j_drec_key_t description in https://developer.apple.com/support/downloads/Apple-File-Sys...

show 1 reply