Skip to content
Novus Examples
zip699 B

ZIP - Zero-Length Members

Three empty files stored three ways - stored, deflated, and deflated behind a data descriptor - beside one real member. An empty deflate stream is still two bytes on disk with CRC 0, so readers that treat compressed size 0 as 'no data' and readers that treat CRC 0 as 'not computed' both go wrong here.

Archive contents — 4 entrieszip
  • empty-stored.txt
  • empty-deflated.txt
  • has-content.txt
  • empty-with-descriptor.txt

Specifications

Seed
20260807
Members
4
Zero Length Members
3
Crc Of Empty
0
Deflated Empty Bytes
2
Note
a deflate stream for zero bytes is still 2 bytes long, not 0

Testing contract

Expected to pass
Scenario
Extract every member and compare each one's length and CRC against the header values.
Expected result
The three empty members extract to exactly 0 bytes with CRC 0 while their compressed sizes are 0, 2 and 2 respectively; has-content.txt extracts intact.

What is a .zip file?

ZIP is a widely supported archive format that bundles multiple files and directories into one container, typically with per-file DEFLATE compression and a central directory index. It supports random access to individual entries without decompressing the whole archive. It underlies many document formats such as DOCX and EPUB.

How to use this file

Use an example ZIP to test archive extraction, central-directory parsing, per-entry decompression, and protection against path-traversal (zip-slip) during unpacking.

How to use this file for testing

“ZIP - Zero-Length Members” is a deterministic Novus Examples fixture for Conversion testing, Error handling. The same content exported across many formats and linked as a group, so you can convert one and diff against the expected twin.

Documented properties for this file: seed 20260807. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Archive fixtures are documented down to their member list (shown on this page) and are deliberately safe — no zip bombs, executables, or hidden payloads. Test extractors against nested, unicode, empty, and encrypted variants.

Code examples

unzip -l zero-length-members.zip     # list members
unzip zero-length-members.zip -d out/  # extract

Generated by generation/archives_p7.py. Free for any use, no attribution required — license.