Skip to main content
coreydaley.dev

Splitting archives into volumes: 7z, ZIP, and compressed tar

Sometimes one big file is the problem: an upload limit, an email attachment cap, a drive formatted FAT32. On May 27 Purrchiver learned to split an archive into numbered parts of whatever size you choose.

Three formats in one day

7z came first, using the standard naming — backup.7z.001, .002, and so on — that 7-Zip, Keka, and The Unarchiver all read.

ZIP followed, producing backup.zip.001-style sets. That’s the same shape other Mac archivers produce when they offer “split ZIP”. One honest caveat: dedicated archive apps open these, but Finder’s built-in Archive Utility doesn’t.

Compressed tar — .tar.gz, .tar.bz2, .tar.xz, .tar.zst, .tar.lz, and .tar.lz4 — came last, and was the hard one.

The crash under the hood

Writing a split compressed tar was easy. Reading one back crashed the app.

libarchive, the engine underneath, can read a multi-part archive by hopping from one file to the next as it goes. For compressed tar, that hop happens in the middle of decompression, and the decompressor’s state doesn’t survive it. The bytes were fine — joining the parts into one file by hand opened perfectly — but the hop itself brought the process down.

So Purrchiver doesn’t let libarchive hop. It presents the whole set of parts to libarchive as one continuous stream, and libarchive never knows there were separate files.

There was one more bug hiding in there. When writing through that kind of custom output, libarchive pads the last block with zero bytes. For a format like Zstandard, those trailing zeros look like the start of a second, corrupt frame. Turning the padding off fixed it.

Opening a split set

Open any part of a split archive and Purrchiver finds the rest — they just need to be in the same folder. It works for Purrchiver’s own sets and for the usual schemes from other tools, like .part01.rar and .r00. The multi-part archives help page has the details.