Rixstep
 About | ACP | Buy | Industry Watch | Learning Curve | News | Products | Search | Substack
Home » Industry Watch » The Technological

They Were in a Hurry?

Classic Apple system design.


Get It

Try It

http://en.wikipedia.org/wiki/Macintosh_File_System
MFS allows file names to be up to 255 characters in length, although Finder does not allow users to create names longer than 63 characters (31 characters in later versions). MFS is called a flat file system because it does not support a hierarchy of directories.

Also:
http://mactech.com/articles/mactech/Vol.01/01.05/Disks/
http://developer.apple.com/samplecode/MFSLives/listing5.html
[Note: above hack written and published in 2006.]

http://docs.info.apple.com/article.html?artnum=9502
1) Question: What is meant by MFS disks?

Answer: The first Macintosh computers used only 400k single-sided disks, formatted as MFS (Macintosh File System) volumes which used a flat file structure, and no subdirectories (folders in Macintosh vocabulary). Although you could create and place documents and folders into folders, they existed only in the Finder's view of the disk.

B*-tree

http://en.wikipedia.org/wiki/B*-tree
A B*-tree is a tree data structure, a variety of B-tree used in the HFS and Reiser4 file systems, which requires non-root nodes to be at least 2/3 full instead of 1/2. To maintain this, instead of immediately splitting up a node when it gets full, its keys are shared with the node next to it. When both are full, then the two of them are split into three. It also requires the 'leftmost' key never be used. The term is not in general use today as the implementation was never looked on positively by the computer science community at large.

http://en.wikipedia.org/wiki/Hierarchical_File_System
4. The Extent Overflow File is a B*-tree that contains extra extents that record which allocation blocks are allocated to which files, once the initial three extents in the Catalog File are used up. Later versions also added the ability for the Extent Overflow File to store extents that record bad blocks, to prevent the file system from trying to allocate a bad block to a file.

5. The Catalog File is another B*-tree that contains records for all the files and directories stored in the volume. It stores four types of records. Each file consists of a File Thread Record and a File Record while each directory consists of a Directory Thread Record and a Directory Record. Files and directories in the Catalog File are located by their unique Catalog Node ID (CNID).

  • A File Thread Record stores just the name of the file and the CNID of its parent directory.

  • A File Record stores a variety of metadata about the file including its CNID, the size of the file, three timestamps (when the file was created, last modified, last backed up), the first file extents of the data and resource forks and pointers to the file's first data and resource extent records in the Extent Overflow File. The File Record also stores two 16 byte fields that are used by the Finder to store attributes about the file including things like its creator code, type code, the window the file should appear in and its location within the window.

  • A Directory Thread Record stores just the name of the directory and the CNID of its parent directory.

  • A Directory Record which stores data like the number of files stored within the directory, the CNID of the directory, three timestamps (when the directory was created, last modified, last backed up). Like the File Record, the Directory Record also stores two 16 byte fields for use by the Finder. These store things like the width & height and x & y co-ordinates for the window used to display the contents of the directory, the display mode (icon view, list view, etc) of the window and the position of the window's scroll bar.

Problems

The Catalog File, which stores all the file and directory records in a single data structure, results in performance problems when the system allows multitasking as only one program can write to this structure at a time, meaning that many programs may be waiting in queue due to one program 'hogging' the system. It is also a serious reliability concern as damage to this file can destroy the entire file system. This contrasts with other filesystems that store file and directory records in separate structures (such as Microsoft's FAT file system or the Unix File System) where having structure distributed across the disk means that damaging a single directory is generally not fatal and the data may possibly be reconstructed with data held in the undamaged portions.

Also:
http://developer.apple.com/documentation/mac/Files/Files-99.html
http://mactech.com/articles/mactech/Vol.01/01.12/HFSFileStructure/
http://www.mars.org/home/rob/proj/hfs/

http://en.wikipedia.org/wiki/HFS_Plus

See Also
http://rixstep.com/2/20031102,00.shtml
http://rixstep.com/2/20041115,00.shtml
http://rixstep.com/1/20050509,00.shtml
http://rixstep.com/1/0/20051130,02.shtml
http://rixstep.com/2/20060216,00.shtml
http://rixstep.com/2/1/20060218,00.shtml
http://rixstep.com/2/20060308,01.shtml
http://rixstep.com/2/20060403,00.shtml
http://rixstep.com/2/20061212,00.shtml

http://www.google.com/search?q=HFS+site:rixstep.com

About | ACP | Buy | Industry Watch | Learning Curve | News | Products | Search | Substack
Copyright © Rixstep. All rights reserved.