How Mac OS 9 Tracked Moved Files and Aliases
Classic Mac OS, culminating in Mac OS 9, featured one of the most resilient file-tracking systems of its era through the Alias Manager and the architectural features of the Hierarchical File System (HFS and HFS+). Unlike simple symbolic links that break when a target path changes, Mac OS 9 aliases tracked files dynamically by combining low-level file system identifiers with path-based and heuristic metadata. This approach allowed the operating system to effortlessly maintain connections to files even if they were renamed, moved to different directories, or relocated on the same disk.
The Role of the Alias Manager
At the core of this capability was the Alias Manager, an operating
system API introduced in System 7 and refined through Mac OS 9. When an
alias was created, the system did not merely record the file's current
path (e.g., Macintosh HD:Documents:Report.doc). Instead, it
generated a specialized data structure known as an alias
record. This record stored comprehensive metadata about the
target file, its parent directory, and its host volume.
Catalog Node IDs (CNIDs)
The primary mechanism that enabled robust reference tracking was the Catalog Node ID (CNID), often called the File ID or Directory ID:
- Persistence: Under HFS and HFS+, every file and folder is assigned a unique 32-bit CNID upon creation.
- Independence from Paths: While the human-readable path to a file changes when it is moved between folders, its CNID remains entirely unchanged within the volume's catalog file (a specialized B-tree structure).
- Direct Resolution: When resolving an alias to a moved file, the Alias Manager used the recorded CNID to query the catalog B-tree directly. Because the CNID remained constant, the system could find the item instantly, regardless of its new folder hierarchy or new name.
The Composition of an Alias Record
To handle scenarios where files were altered or moved across different disks, an alias record stored multiple layers of tracking information:
- The File CNID and Parent Directory CNID: Identifies the item and its containing folder.
- Absolute and Relative Paths: Preserved the original folder hierarchy for path-based traversal.
- Volume Attributes: Tracked the volume name, volume creation date, and drive format to confirm the target was on the correct disk.
- Metadata Fingerprints: Stored static metadata including the file's Mac OS type and creator codes, file size, and creation timestamp.
Resolution and Self-Healing Workflow
When a user double-clicked an alias or an application resolved an alias record, Mac OS 9 executed a two-step resolution algorithm:
- Fast Search: The system first checked the stored volume and attempted to locate the item by its CNID. If the CNID matched and basic metadata (such as the creation date) aligned, the file was identified immediately, even if it resided in an entirely different folder.
- Exhaustive/Heuristic Search: If the CNID lookup failed (such as when a file was restored from a backup or replaced), the system fell back to heuristic matching. It searched the volume for items sharing the original filename, creation date, and type/creator codes.
- Self-Healing (Dynamic Updating): Once the target file was relocated, the Alias Manager updated the alias record in the background. It rewrote the internal path and parent directory identifiers to match the file's new location, ensuring future lookups remained fast and direct.