1. Peel
  2. The Pith
  3. Rind on its own
Essay · Engineering

Rind: An Archive Engine That Stands on Its Own

When an upload arrives damaged, the engine reports what survived and the application decides what happens next.

By · · The Pith, no. 15 · 6 min read

An orange half zested beside a steel zester and a pile of orange zest, with a sketch of a cut orange behind them

Say I’m running a publication that accepts submissions as ZIP files. The form requires two files, manifest.txt and captions.txt. A contributor’s upload finishes, but the ZIP is cut off halfway through the captions. The site has received a file. It still has to find out what’s inside.

In a small test of this scenario, I gave Rind a ZIP containing a complete manifest and two captions, then cut it off after the first caption. The integrity check exited with code 5, which means the archive is damaged. I ran salvage separately. Here are the two entries from its report, reduced to the fields the site needs for this decision:

[
            {"name": "manifest.txt", "status": "recovered"},
            {"name": "captions.txt", "status": "partial"}
          ]

Salvage itself exited successfully. It had done what I asked and produced a report. The site still had to compare that report with its submission requirements. The manifest was accounted for. The captions were required and only partially recovered, so the site could tell the contributor, “We recovered manifest.txt. Please resend captions.txt.”

That’s why I want Rind to stand on its own. Rind is the Rust archive engine behind Peel. In the Mac app, a person can look at the recovery results and decide what to do. A submission service needs those results as data so it can apply its own rules and tell the contributor what happens next. Rind developer documentation · Rind CLI reference

What survived the upload?

A ZIP normally carries a directory at the end, but individual files also have local headers. If the directory is gone and some local headers survive, Rind’s ZIP salvage path can use those records to look for recoverable entries. In my test, the recovered manifest matched the original byte for byte. The partial captions file contained the first caption. ZIP format specification

An entry whose header is gone may leave no record in the salvage report. That’s another reason the submission requirements matter. If the report had said nothing about captions.txt, the site would still know it was expected and could ask for it again. And if the submission allowed optional files, the site would need a separate record of what the contributor intended to send before it could name any of those as missing.

I’d keep the recovered manifest in a review area and leave the submission open. The partial captions might help an editor, but I’d keep them out of the publishing queue. The engine reports what it found. The publication decides what it can use.

What belongs in the engine?

Archives tend to arrive under filenames that somebody else chose. Rind can detect a format, inspect the container, and report the entries and available metadata. For supported inputs, it can return one member, extract a selection or the whole archive, create an archive, or test its integrity. Recovery is a separate operation with its own limits. The format matrix breaks those capabilities out because saying a tool “supports” a format leaves a lot for the caller to find out. Rind format matrix

There are choices I’d rather make once in the engine. When an extraction writes files, it needs a policy for destination paths, names that collide, and how much output it can accept. When inspection can’t establish a modification time, the caller should be able to tell that it’s unknown. When an operation fails because the archive needs a password, the application should have a way to distinguish that from damage and decide how to respond. The next tool that calls Rind should be able to use those decisions without inheriting the interface Peel built around them. Rind library guide · Peel’s extraction safety notes

The caller still has work to do. A publishing system decides which files it expects, who can approve an import, and whether an image is suitable for publication. Rind can hand it the bytes of a JPEG. The image pipeline decides whether it can decode them, makes the thumbnail, and applies whatever color or metadata policy the publication needs. I want the boundary there because archive handling and publication have different reasons to change.

What could another tool build?

An ingest service could start by inspecting an upload and comparing the listing with what the submission form asked for. It could read a manifest, route the assets to the appropriate processors, and ask for a replacement when the archive fails an integrity check. If it offers salvage, it could keep recovered files and partial output in review with the engine’s report attached.

A catalog has a different reason to look inside. An EPUB or comic archive can stay together as a stored object while the catalog asks for the metadata or cover it needs. A batch job might use the same engine to verify a set of archives and send the failures to a human for review. It can do useful work with a report alone.

Rind exposes the archive work through a Rust library, a C interface, the peel command line, and an MCP server. Peel’s Quick Look extension and archive service call through the C interface, and the app drives the peel command line. A script can run peel inspect and read JSON. An MCP client can use the operations the server exposes. The right interface depends on where the calling program runs and who owns the process. A batch job and a native app can both ask for archive information without sharing a screen or a release cycle. Rind integration guide

The format can still dictate how much work a request takes. Rind can keep a ZIP open and reuse the directory across member reads. Reaching a late entry in a solid block can still require decoding what came before it. I covered the user-facing side of that in Why Are We Still Extracting Archives? For a tool author, the practical question is whether it’s worth reading one member, reading several together, or extracting a working copy for the next stage. Those are workload decisions. 7-Zip’s notes on solid archives

When I’d reach for libarchive or 7-Zip

I’d reach for libarchive when I’m writing a portable program that needs to walk entries from a stream. It has a C API for reading and writing a wide range of formats, and I can supply my own I/O callbacks. Its bsdtar tool can already send a selected entry to standard output. I checked that on a small ZIP and got the same member bytes from bsdtar and Rind. If my program mainly needs entry headers and a stream of bytes to process, that’s a good fit. Libarchive · Libarchive’s I/O interface

I’d reach for 7-Zip when the job is to create a 7z archive and tune its compression settings, test a 7z archive with the reference tool, or handle a format that 7-Zip supports and Rind doesn’t. Its command line already lists, tests, and extracts archives, and it can write extracted data to standard output. Those are useful operations in their own right. 7-Zip’s supported formats · 7-Zip’s command-line reference source

I’d consider Rind when one workflow needs several archive operations and has to make different decisions from their outcomes. The submission service is a good example. It needs a description of what arrived, a way to read particular members, a separate integrity check, and a recovery result it can put in front of a person. It could assemble those pieces around other tools. The case for Rind is having those operations available from the same engine, with their limits made explicit. For a new deployment, I’d check platform and distribution support as part of that choice. The Rust source is private, and peel-core is unpublished on crates.io. Rind’s integration options and limits

What the site can say

Back at the submission form, the contributor has one file to resend. The editor can review the manifest while they wait. The site can explain that state because it has two pieces of information. Rind reported what survived, and the submission rules told the site what it still needed.

Peel can show the recovery report to someone at a Mac. The submission service can put it to work in a different way. That’s what I want from an engine that stands on its own. The next tool can make its own decision because it knows what happened inside the archive.

Read next · No. 10 · EngineeringWhere Swift Ends and Rust BeginsHow that engine sits behind a native app: ownership, cancellation and errors at the boundary between Swift and Rust.
Peel's icon: an orange on a cream tile

Get Peel. Free forever.

No account, no ads, no trial. Everything Peel does today stays free, and it keeps itself up to date.

Download Peel 1.4.0 brew install --cask snackstudio/tap/peel
Requirements
macOS 13 Ventura or later, on Apple silicon or Intel.
Install
Open the installer and follow it. Or open the disk image and drag Peel to Applications, or run brew install --cask snackstudio/tap/peel in Terminal.
Updates
Peel updates itself, and every update is signed. To check now, choose Peel ▸ Check for Updates…
Uninstall
Drag Peel to the Trash, or run brew uninstall --cask peel.
Price
Free. No account, no ads, no trial.
Privacy
Your files never leave your Mac, and the app has no analytics. This site counts visits to learn what helps; the privacy policy says how.