Resource fork

On this page 6

A resource fork is a second, structured stream of data attached to a file on Apple file systems, stored alongside the ordinary data fork under the same file name. It was designed for the classic Mac OS to hold typed resources such as icons, menus, dialog layouts, fonts and executable code, and it survives in macOS today as a named extended attribute, com.apple.ResourceFork, that Finder and the system still read.

For everyday work with Finder & files, the resource fork explains several puzzling behaviors: files that lose their custom icons after a trip through a USB stick or a ZIP archive, mysterious dot-underscore files on shared drives, and legacy documents that appear empty on other systems because their real content lived in the fork that was discarded.

How the resource fork is structured

Unlike the data fork, which is an unstructured byte stream interpreted only by the application that wrote it, the resource fork has a fixed internal format defined by Apple. It starts with a header, followed by resource data and a resource map that indexes every entry by a four-character resource type and a numeric resource ID, with an optional name.

The classic Resource Manager loaded entries on demand through this map, which allowed programs to fetch one icon or one string list without reading the whole file. The format limits a single fork to 16 megabytes, a ceiling that became one of the reasons Apple moved away from it.

The fork was paired with Finder information stored in the file system catalog: a four-character type code and creator code that told the classic Finder which application opened a document. Together, the two mechanisms let classic Mac OS work without file name extensions. Modern macOS relies on extensions and Uniform Type Identifiers instead, although it still reads the old codes when they are present.

The table lists frequently encountered resource types and what each contained.

Resource typeContentTypical owner
icnsIcon family in several sizesApplications and custom icons
CODE68k executable code segmentsClassic applications
MENUMenu titles and itemsClassic applications
DLOG and DITLDialog windows and their itemsClassic applications
STR#Lists of localized stringsApplications and documents
sfntTrueType or OpenType font dataSuitcase font files
versVersion information shown in Get InfoApplications
Common classic resource types

Resource forks in modern macOS

Since Mac OS X, Apple has steadily replaced resource forks with application bundles, property lists and separate files inside folders. Modern applications keep icons as .icns files and interface layouts as compiled storyboards within the bundle, so they need no resource fork at all.

The mechanism has not disappeared. On HFS+ and APFS volumes, macOS stores a resource fork as the extended attribute com.apple.ResourceFork, and Finder still uses it for custom icons applied to files, for some legacy font suitcases and for files copied from older systems. The fork can be inspected in Terminal by appending the special path suffix ..namedfork/rsrc to a file name or by listing extended attributes with the xattr command.

MechanismWhere data livesMain use today
Resource forkcom.apple.ResourceFork attributeCustom icons and legacy files
Extended attributesNamed attributes on the fileFinder tags, quarantine flags
Application bundleFolder with Contents and ResourcesModern apps and their assets
.DS_StoreHidden file in each folderFinder view and window settings
Uniform Type IdentifierSystem type databaseIdentifying file types
Resource fork compared with related metadata mechanisms

What happens to resource forks on other file systems

Most non-Apple file systems have no native place for a resource fork. When macOS copies a file to FAT32, exFAT or many network shares, it stores the fork and other extended attributes in a companion file whose name begins with dot-underscore, a format known as AppleDouble. Windows and Linux users see these hidden files as clutter, and deleting them silently removes the Mac metadata.

DestinationHow the fork is keptRisk of loss
APFS or HFS+ volumeNative extended attributeLow
FAT32 or exFAT driveAppleDouble dot-underscore fileHigh if companions are deleted
SMB network shareNamed stream or AppleDouble fileDepends on server settings
ZIP from Archive Utility__MACOSX folder with AppleDouble dataHigh when unpacked elsewhere
Email attachment or uploadUsually strippedVery high
Resource fork handling by destination

Historically, files were wrapped in BinHex or MacBinary formats before transfer precisely to keep both forks together. Today, the safest transfer for a file that still depends on its fork is a disk image (DMG) or an archive created and opened on a Mac.

Practical handling and common mistakes

For most current files the resource fork is optional decoration, and losing it changes only the icon. For legacy documents, fonts and classic applications, it can contain the essential content, so preservation matters in archives and migrations.

  • Deleting dot-underscore files on a shared drive removes custom icons and other Mac metadata from the matching files.
  • Using cp without care in scripts may drop extended attributes; ditto preserves them by default.
  • Uploading legacy suitcase fonts to cloud storage often leaves zero-byte files, because the font data lived in the fork.
  • Running dot_clean merges or removes AppleDouble files deliberately, which is safer than manual deletion.
  • Assuming a zero-byte file is empty can be wrong on a Mac; checking the fork size in Terminal confirms it.

Put simply

A Mac file can have two compartments. The main one holds the actual content, such as text or a photo. The second one, the resource fork, holds extras like a custom icon or old program parts.

Picture an envelope with a small pocket on the back. The letter goes inside. Stickers and notes go in the pocket. If you hand the envelope to a system that has no pocket, the extras can fall out. Most modern files barely use the pocket, but some old files keep everything important there.

In practice

A design studio migrates a 20-year-old font library from an old Mac server to a cloud folder shared with Windows colleagues. After the upload, dozens of classic suitcase fonts appear as zero-byte files and refuse to install, although they worked perfectly on the Mac.

An administrator checks the originals in Terminal and finds that each font stored its data in the resource fork, which the cloud service discarded. The team copies the originals into a disk image, converts the suitcases to standalone OpenType files with a font utility, and uploads those instead. The converted fonts install on both macOS and Windows, and the studio adds a rule to its archive policy: legacy Mac files travel only inside DMG images or Mac-created archives.