← Mac Change Notes

Mac Resource Fork Size: Beyond the Data Fork

On a Mac, a file can have a resource fork alongside its main data. Start with Terminal’s built-in ls -l@ for the exact file: a zero-byte main size does not prove that the resource fork is empty.

In this article

Inspect one file without changing it

In Finder, select the item and press Command-I to confirm its location and the size Finder displays. If another tool reports a different number, keep both readings and identify what each includes. Do not delete the file merely because one report says zero.

For an ordinary local file you control, open Terminal and run this read-only check, replacing the example path with the actual path:

/bin/ls -l@ "/path/to/file"

The main listing has a size column. Additional indented lines list extended attributes and their lengths. Look specifically for com.apple.ResourceFork. The @ alone only says extended attributes exist; another attribute may be responsible. Our guide to the @ and + in Mac permission listings explains those markers separately.

Keep the path in quotes, especially when it contains spaces. For a symbolic link, verify which object you intend to examine before comparing results. This walkthrough concerns ordinary files, not a folder’s recursively calculated size or an application bundle’s combined contents.

Separate three different questions

The main data fork is the byte stream an ordinary read of the file exposes. A resource fork is additional associated data. It has historically held structured resources such as icons; its name does not tell you whether the contents matter to the document or application.

Apple’s archived getxattr manual describes extended attributes as named data associated with filesystem objects and documents a way to ask for an attribute’s size. It also explicitly distinguishes the resource-fork attribute in its interface.

QuestionUseful observationLimit
How many bytes are in the main data fork?The ordinary file size reported by stat -f %zDoes not inventory every associated attribute
Is there a resource fork, and how long is it?The com.apple.ResourceFork line in ls -l@Does not explain or validate its contents
How much space would deletion reclaim?Requires filesystem and retention contextNeither of the two lengths alone answers it

A length is a count of bytes, not a safety verdict. A normal resource fork can be useful; its presence alone is not evidence of malicious software. Conversely, an unfamiliar attribute name does not certify that a file is harmless.

A controlled test with an empty main fork

On December 4, 2026, we created one disposable text file on macOS 15.7.5, build 24G624, Apple Silicon. We first left its main data empty, then wrote 32,768 test bytes into its resource fork. We subsequently added 14 bytes of main data and a separate 128-byte custom attribute.

At each stage we recorded the built-in ls -l@ output and /usr/bin/stat -f '%z'. We also queried attribute lengths with the operating system’s getxattr interface.

Fixture stageOrdinary stat sizeResource-fork lengthAdded custom attribute
Empty file0 bytesAbsentAbsent
Resource fork added0 bytes32,768 bytesAbsent
Main text written14 bytes32,768 bytesAbsent
Custom attribute added14 bytes32,768 bytes128 bytes

The second row is the important result: the main size remained zero while the resource fork held data. Writing the main text changed that size to 14 without removing the resource fork. Adding the custom attribute did not increase the ordinary size either. macOS also supplied a small provenance attribute, recorded separately in our test log.

These were deliberately chosen test bytes, not a valid icon resource or a real application document. The test demonstrates separate storage and measurement; it does not prove that an arbitrary application can read those bytes, that Finder uses the same calculation on every version, or that deleting the fixture would free a particular number of physical blocks.

No existing documents, app libraries or privacy settings were changed.

Why Finder and another tool can disagree

Before calling a size wrong, check its definition. A program may report main data length, combine selected forks, total a directory, or estimate allocated storage. Those are different operations even when the interface calls each result “size.”

Howard Oakley’s measurements of crafted files document changing Finder behavior and the distinction between data, resource forks and other attributes. Our test here is deliberately narrower: it shows what the named command-line checks returned on the recorded Mac. It does not extrapolate a universal Finder formula.

For a primary implementation example, the Samba project’s current vfs_fruit documentation describes different ways a server can store Mac resource-fork data. That matters when comparing a local file with a copy on a network share: storage representation can change even when the intended document stays the same.

Do not treat a neighboring ._ file as an unrelated duplicate without checking the transfer context. Our AppleDouble file guide explains why metadata may be carried separately. Resource-fork length is also a different issue from sparse files and allocated storage.

Preserve useful data when copying or cleaning up

If you are evaluating an archive, backup or copied folder, test a disposable representative file through the actual transfer workflow. Compare the main data and associated attributes at both ends, then open the copied document in the application that needs it. A matching main-file size alone is insufficient evidence of a complete transfer.

A practical record includes:

  1. The source and destination filesystem or service.
  2. The exact file, with private path details removed before sharing.
  3. Main data length and resource-fork length, recorded separately.
  4. The copying or archiving tool and its relevant options.
  5. Whether the resulting document behaves as expected in its application.

Avoid clearing every extended attribute as a space-saving experiment. Different attributes have different purposes, and the resource fork may contain data you intended to preserve. First establish which file belongs to the workflow and whether the copy or backup retains what you need.

For the immediate size question, inspect the main listing and the resource-fork line separately. That small distinction prevents an incomplete zero-byte reading from becoming a reason to discard a nonempty file.