Mounting a ZIP as a Finder volume: a field report from FSKit
What it took to make an archive show up in Finder as a real, read-only volume, and what I learned about building on an extension framework the operating system keeps the keys to.
The folder that isn't there
I double-click project.zip in Downloads. Finder should show me what's inside, in the same window, and the ZIP should stay exactly where it is. When I'm done, I press Back and I'm in Downloads again, with nothing new sitting next to the archive. (That is the goal. Whether it happens today depends on a switch I don't control, as the last sections explain.)
That is the experience I want Peel to give, and it is harder than it sounds. A ZIP is a file. A folder is a directory. Finder navigates directories. The honest way to bridge those two facts is not to unpack anything, but to convince the operating system that a directory exists whose contents happen to live inside the ZIP. That means a filesystem.
A mounted volume is the truest version of "open like a folder": entries appear when you list them, bytes arrive when you read them, and nothing is copied until you ask. Quick Look, drag-out and every other app see ordinary paths.
On current macOS, the way to write a filesystem without a kernel extension is FSKit. This is a field report on trying to ship one.
What FSKit is, in my own words
FSKit is Apple's framework for filesystems that run as app extensions in user space. You don't write a kernel driver. You write a module that macOS loads on demand, and you answer questions: can you handle this resource, what is its root, what are the children of this directory, give me bytes 4096 through 8192 of this file.
Mine is called PeelFS, embedded in the direct edition of the app (the Mac App Store edition doesn't include it) and registered under the com.apple.fskit.fsmodule extension point. A few Info.plist declarations matter most:
- It mounts a path, not a disk. Most filesystem examples assume a block device. An archive is a file, so PeelFS declares that it supports path URLs and not block resources.
- It asks for security-scoped access to that path. The extension is sandboxed and can reach Downloads and files the user selected, so without a scoped URL an archive in some other folder can't be opened at all. The module holds that scope from the moment it loads the resource until the volume unmounts.
- It tells the system to ignore ownership, because the uid and gid stored in an archive belong to whoever packed it, not to anyone on this Mac.
The lifecycle is small: probe decides whether the module can serve the resource, load opens the archive and builds the volume, activate hands back the root, unmount releases the security scope. A read-only filesystem has almost nothing to flush, which is a relief.
Mapping an archive onto a volume
On load, the module lists the archive once through the same engine the rest of Peel uses and builds the whole directory tree up front. Every path component becomes a directory, including the ones a ZIP never lists explicitly, because ZIPs are casual about that. Where a file and a directory claim the same path, the directory wins. The volume reports zero free space, which is both true and a pleasant hint that you can't write to it.
Everything that would modify the volume returns a read-only error. I wanted no ambiguity about what a mount is for.
Reads are the interesting part. When something asks for a file's bytes, the module extracts that one entry into a cache folder private to this mount, and then serves every read as a byte range from that file. Memory stays flat no matter how big the entry is, which matters when someone opens a multi-gigabyte video from inside a ZIP. There are budgets on all of it: a cap on entries per volume, a cap on any single entry, and a cap on how much extracted data the mount keeps on disk, evicting the least recently read first.
The part I'm proudest of is a rule I added after some paranoia: a read must return exactly the entry that was asked for. The extracted file has to sit at that entry's own path and, when the listing records a size, match that size. If it doesn't, the read fails with an I/O error. It never returns some other entry's bytes. A filesystem that quietly serves the wrong file is worse than one that fails.
Solid archives and the quadratic trap
ZIP is friendly: every entry can be reached directly, so reading one file costs about one file. TAR and solid 7z and RAR are not. In a TAR, everything sits in one stream. In a solid archive, an entry can only be decoded after the ones before it. If you extract entries one at a time, each read decompresses from the start, and reading N files costs on the order of N squared.
I measured it rather than trusting my intuition. On an M-series Mac, reading every file in .tar.gz archives of 1,000-byte text files took 11 seconds for 2,000 files entry by entry, against 0.36 seconds when the archive is extracted once up front. At 20,000 files the entry-by-entry run was around 895 seconds (I timed every 200th file and scaled it), against 3.6 seconds the other way. So for those formats the module extracts the whole archive once on first read and serves everything from there, within a 4 GiB disk budget, with a fallback to the slow path when the numbers don't fit. ZIPs stay entry by entry.
The trade: the first read of a solid archive pays for everything. I would rather the first click be slow once than every click be slow.
The parts nobody warned me about
FSKit is young, and the documentation shows it.
The switch isn't yours. macOS keeps a separate on/off switch for each filesystem module, under System Settings ▸ General ▸ Login Items & Extensions ▸ File System Extensions. An app can't flip it. Peel can read the state and can open the right Settings page, and that's all. Until the user turns it on, mounting fails with a plain message that the module is disabled.
My rule: Peel never fights the system's switches. I don't script the toggle, edit FSKit's state files or force a module on. Those switches belong to the person using the Mac. If the system says no, the right response is to be useful anyway.
Two switches look the same. The plugin framework has its own enabled flag, separate from FSKit's. For a while I trusted a plus sign in pluginkit output that meant something else. FSKit's real state lives in its own settings container, and I check it there, read only.
Registration has to be trusted. FSKit only lists a module from a trusted Launch Services registration of its app. A copy registered some other way can leave the module out, and duplicate copies on disk confuse things further. I keep exactly one development-signed copy around while testing.
Signing is its own project. The extension needs a provisioning profile that includes the FSKit capability, and a release build needs a Developer ID profile, not the development one Xcode embeds. The signature also has to carry the profile's application and team identifiers, because FSKit reads the module's team from them. When they were missing, the log showed an error retrieving the team ID and System Settings flipped the switch straight back off. The symptom was only a toggle that wouldn't stay on.
Logs are the real documentation. In zsh, log is a shell builtin, so call /usr/bin/log by full path and ask about fskitd, fskit_agent and mount.
Where it stands, honestly
Here is the part I'd rather say plainly. As of this writing, the module is built, signed and passes my tests of its reading logic, but it has not yet mounted on my test Mac through the ordinary route. On macOS 27.0.1, the File System Extensions switch won't stay on for any third-party module I tried, including another shipping app that takes the same path-URL approach. I've ruled out my side as far as I can (notarized build, correct identifiers, one trusted registration) and reported it to Apple (feedback FB25209882). When the module is enabled by hand, it mounts and serves files; I have not made that work for a normal user. It also covers only ZIP-family, 7z, RAR and TAR archives that aren't encrypted.
So what users get today, when browse is their double-click choice, is the fallback: Peel unpacks the archive into a browse folder beside it, which I'll describe in the next piece. The FSKit path is tried first in the direct edition, so if the system starts loading the module, it takes over without anyone updating anything. I would rather ship that than pretend the mount works when I haven't seen it work for a normal user.
The performance idea that survives either way
A browse folder is expensive to build and cheap to keep, so Peel keys it to the archive's identity: modification time plus size, which I call the stamp. If the stamp matches, the folder is reused as is. If the archive changed, it is replaced. That is the idea I'd keep if I rewrote everything else.
Mounts also clean up after themselves. Peel watches the volumes it created and unmounts one 5 to 7 seconds after no Finder window shows it, never forcibly: if a file is open or being copied, the unmount fails and is tried again on the next pass. A volume whose archive changed on disk is unmounted too.
What I'd warn you about
If you're considering a filesystem extension, a few things are worth knowing before you start.
The code is the easy part. The difficult part is everything around it: profiles, identifiers, registration, and a user-controlled switch you cannot touch.
Design for the module not being there. The extension is a bonus path, never the only path.
And test your reader without the framework. I compile the archive-reading code on its own, outside FSKit, and check every file against the command line tool's own extraction. That caught more bugs than clicking in Finder, and it kept me moving while the system side was out of my hands.
I think it is the right foundation, but I wouldn't plan a launch around it yet.
Peel is free for macOS 13 or later. Get Peel, or install it with brew install --cask snackstudio/tap/peel.
Next in the series: Opening an archive like a folder: two ways