## What is HFS+

HFS+ is the new Filesystem intodruced my Apple around MacOS8. It became necessary because its predecessor, HFS, had a fixed numer of blocks (2^16), and on large volumes theses block became very large, wasting a lot of space. HFS+ solves this problem and intodruces some new concepts like Unicode file names.

Detailed Documentation can be found in Technote 1150 HFS+ Volume format and in File Manager.

In contrast to unix-like file Systems, HFS+ (and HFS+) work like indexes in a database. As with databases The index is composed of keys structered in a B*-Tree. (A B*Tree is basically a n-ary tree located in nodes on a volume. This way acces to any file is pretty fast at the price of a complex insert / delete management. I migt provide some O(..) notation here but dont want to get blamed by some Theoritican :) . The B*-tree is composed of index nodes and leaf nodes. Index nodes contain ordered keys that point to deeper index- or leaf-nodes. Leaf nodes contain keys and associated file or folder records. The keys and records have variable length but an additional index at the end of every node allows indexed acces.

Apple places additional restrictions on the B*-Tree:

- All leaf nodes are found a the same depth
- All nodes of the same depth are linked foreward and backward
- ... More I dont remember right now.

The keys are composed of the unique id of the parent folder and the (specially encoded) unicode name of the file. The folder THREADS are needed to retrive the parent folder for a given folder id. Theese use an empty name and are simliar to the '.' directory in unix.

Files and the B*Trees themselfes are stored in forks. For files these are the Apple-like data- and resource-fork. With HFS+ every files may have up to 8 not continuos parts until the additional parts are found in the Extends record. This Extends record is used for the catalog file (fork) and other forks, too. So that theese have fixed record ids, too.

        $Id: hfsp.html,v 1.1.1.1 2002/03/05 19:50:28 klaus Exp $