1.1.0
Central Directory
Zip files that lost their central directory are rebuilt from the local headers still standing in the stream.
A zip file keeps its index at the very end, which means an interrupted upload loses exactly the part every reader asks for first.
The reports that led to this release were all the same shape. A 3 GiB export stops at 2.7 GiB, the central directory was in the missing 300 MiB, and the archive utility shows an empty window. The entries themselves are fine. Each one is preceded by a local header with its name, its sizes and its CRC-32, and those headers are still standing in the stream like fence posts after the fence has gone.
tsugi now walks the stream, finds each local header, inflates the entry behind it, and checks the result against the stored CRC. Entries that verify are listed in a fresh central directory, which is written with a new end record. Streaming zips, where the sizes follow the data instead of preceding it, take longer because the only way to find the end of an entry is to decompress it.
One thing does not come back. Unix permissions, entry comments and some timestamps live only in the central directory, so when it is gone they are gone. tsugi writes 0644 and the local header's DOS time, and says so in the report.
$ tsugi mend export-2025-08.zip
reading export-2025-08.zip 2.7 GiB, no end record
found 1,286 local headers
kept 1,285 entries, CRC-32 verified
partial media/site-walk-04.mov stream ends mid-block
joined central directory rebuilt, 1,285 records
assumed mode 0644 on 1,285 entries
wrote export-2025-08.mended.zip exit 3
In this release
- Added
Zip support. A missing or damaged central directory is rebuilt from the local file headers.
Entries written with data descriptors are sized by inflating them to the end of their stream.
Zip64 records are written when the rebuilt archive needs them.
- Mended
A
PK\x03\x04signature that happens to occur inside a stored entry no longer starts a phantom member. A candidate header must lead to data that matches its CRC-32.Sparse GNU tar members are no longer reported as partial.
- Changed
The archive type is read from its contents, not from its file extension.
The seam report lists every permission and timestamp tsugi had to assume.