I see “HFS+ sucks” from time to time, and as a Linux user who doesn’t think about proprietary filesystems much, it got me wondering; what are the actual differences between the two?
HFS+ | NTFS | |
---|---|---|
Endian-ness | Big | Little |
Encoding | UTF-16 | UTF-16 |
Normalisation | NFD1 | ?2 |
Case-sensitive | Both3 | Both |
Sparse File | No | Yes |
Time Resolution | 1 s | 100 ns |
Snapshots | No | No |
Concurrent Access | No | ? |
- The endian problem is not the fault of the filesystem, but rather the system you use to access it. Unless you go the ZFS route and have a bi-endian system.
- There is mention of HFS+ being not being exactly NFD, but I can’t find specifics
- I can’t find how or if NTFS normalises names.
- Case-insensitive by default on OS X, case-sensitive on iOS
Linus Torvalds' rant on HFS+ being case-insensitive and normalised
Linus
Did anybody check that “…” can’t be fooled to do the same thing on HFS+? In particular, how does the character sequence “dot” “zero-width-utf8” and “dot” work? Or “zerowidth” “dot” “zerowidth”? Does it work like “…”? Because if it does, your fix is incomplete, and people can populate things in random places above the git tree.
Finally, did you check that “tolower” works on a ucs_char_t? It’s not supposed to, afaik.
Quite frankly, HFS+ is probably the worst filesystem ever. Christ what shit it is. NTFS used to have similar issues with canonicalizing utf8 (ie using non-canonical representations of slashes etc). I think they at least fixed them. The OS X problems seem to be fundamental.
Philip
For a great rant about HFS+ by +John Siracusa check out http://5by5.tv/hypercritical/56
Linus
+Philip Durbin I didn’t listen to all of it, but while +John Siracusa isn’t a fan of HFS+, he’s not even ranting about the true insanities of that filesystem.
Sure, it’s old. Sure, it does a horrible job of actually protecting your data. But those are more “it’s not a great filesystem” issues. They aren’t “that’s incredible crap designed by morons that have a hard time figuring out how to feed themselves”.
The true horrors of HFS+ are not in how it’s not a great filesystem, but in how it’s actively designed to be a bad filesystem by people who thought they had good ideas.
The case insensitivity is just a horribly bad idea, and Applie could have pushed fixing it. They didn’t. Instead, they doubled down on a bad idea, and actively extended it - very very badly - to unicode. And it’s not even UTF-8, it’s UCS2 I think.
Ok, so NTFS did some of the same. But apple really took it to the next level with HFS+.
There’s some excuse for case insensitivity in a legacy model (“We didn’t know better”). But people who think unicode equivalency comparisons are a good idea in a filesystem shouldn’t be allowed to play in that space. Give them some paste, and let them sit in a corner eating it. They’ll be happy, and they won’t be messing up your system.
And then picking NFD normalization - and making it visible, and actively converting correct unicode into that absolutely horrible format, that’s just inexcusable. Even the people who think normalization is a good thing admit that NFD is a bad format, and certainly not for data exchange. It’s not even “paste-eater” quality thinking. It’s actually actively corrupting user data. By design. Christ.
And Apple let these monkeys work on their filesystem? Seriously?
There are lots of good reasons to not move to ZFS (cough-Oracle-cough), but they could have pushed people to case-sensitive HFS+, which would have then made it much easier to (in the long run) migrate to anything else saner. But no. There is a case sensitive option, but Apple actively hides it and doesn’t support it.
The stupidity, it burns.
So you had all these people who made really bad decisions and actively coded for them. And I find that kind of “we actively implement shit” much more distasteful than just the “ok, we don’t implement a lot of clever things” that John complained about.
Rant over.
Stack Overflow NTFS’s MFT compared to ext3
Ars Technica John Siracusa review of HFS+ in OS X 10.7