Is the Mac file system is utter c…?


“I don’t think they’re equally flawed – I think Leopard is a much better system,” he said. “(But) OS X in some ways is actually worse than Windows to program for. Their file system is complete and utter crap, which is scary.”

Linus Torvalds cited in The Sydney Morning Herald

While Torvalds is known for not mincing his words when describing products that compete with Linux (the OS he wrote the kernel for), this statement seems — on the face of it — quite extreme. There is, however, some truth in it.
HFS+ was first seen commercially in Mac OS 8.1 (I remember debating whether or not to use it — I did and it worked fine for graphics workstations at the print shop where I worked). Mac OS 8 was a classic Mac operating system based on the previous generations of the Mac OS, this line genealogy discontinued with Mac OS 9.
With Mac OS X, Apple provided a completely redesigned operating system based on BSD UNIX and components from the acquisition of NeXT. The combination of BSD UNIX and NeXT’s development tools and Runtime, the latter renamed Cocoa by Apple, provided a stable platform for rapid application development and typical operating system tasks. It didn’t however support the applications developed for use with previous versions of the Mac OS. Apple solved this problem in two ways, initially by creating a compatibility layer: the Classic environment, and secondly by creating an API that allowed applications to be developed and run natively: Carbon.
In order to support Carbon applications, Apple was forced to implement HFS+, the file system used by classic Mac OS. Problem areas with this approach are:
  • Case insenstivity in HFS+ (UNIX is case sensitive, though HFS+ is case preserving; you have the option of choosing case sensitivity in Mac OS X 10.3 and later)
  • Incompatible metadata schemas in HFS+ and UNIX
  • Translation between Carbon colon path separators and UNIX slash path separators
  • Lack of support for real hard links (Mac OS X has kernel symlinks that emulate hard links)
  • Catalogue Node IDs (CNIDs) — file identifiers that allow Carbon programs to access files without recourse to a path — are completely unsupported by Cocoa and the UNIX layer
  • Use of traditional HFS+ resource and data forks, instead of a single file
Given the fact that things like journalling have been added to HFS+ in the last few years, it is no surprise that some areas of the file system are beginning to creak a little.
All in all, HFS+ for Mac OS X is a workaround that helped Apple get Classic applications onto their operating system. While I completely understand the motivation behind this, I believe that criticisms of this move are — to some extent, and particularly from the point of view of a software developer — valid.


Tags: , , ,

%d bloggers like this: