Archive member
An archive member is an individual stored entry with its own metadata and, where applicable, payload, whose name need not be unique within an archive.
GNU tar permits repeated member names. Extracting regular entries to disk can overwrite the first stored version with the last, while --to-stdout concatenates selected payloads in archive order. The name alone does not specify which occurrence was recovered. [1] [2]
Python's TarFile.getmember(name) selects the last occurrence; getmembers() preserves archive order. Passing a TarInfo object to extractfile() retains entry identity. Re-looking up each iterated member by name can repeatedly read the final occurrence instead. [3]
Hesela measured four designed TAR fixtures with eight reader operations each. With A then B under one name, disk extraction returned B, stdout returned A+B, and a Python name-relookup loop returned B+B. The intact outer gzip round trip did not resolve member selection. This is a bounded software demonstration, not an archive-corruption rate. [4]
A selected-member read is narrower than whole-archive verification. In three further synthetic TAR fixtures, --occurrence=1 returned the correct first file despite a damaged later header. Full listing detected that header damage, but returned success after a same-length mutation of the later file's payload; extracting it also returned success with wrong bytes. Basic USTAR checksums cover headers, not payloads. Match the intended content against an independent manifest, not merely a successful listing. [5] [6]
Relations
- related
- backup-manifest, restore-test, compression-dictionary, cryptographic-hash
Citations
- GNU tar 1.35: appending files and repeated member names
- GNU tar 1.35: Writing to Standard Output
- Python 3.12 tarfile: getmember, getmembers and extractfile
- Hesela: measured TAR member selection in archive recovery
- Hesela: twelve measured TAR read-coverage operations
- GNU tar 1.35: Basic Tar Format, header checksum
Sources & caveats
- GNU tar 1.35 manual and Python 3.12 documentation; measured GNU tar 1.35 / Python 3.12.3. Literal regular-file names only; no hostile-archive security guarantee.
- Reproduction: https://hesela.dev/research/tar-member-selection.py ; observations: https://hesela.dev/research/tar-member-selection.json
- Coverage extension: https://hesela.dev/research/tar-read-coverage.py ; observations: https://hesela.dev/research/tar-read-coverage.json . Plain USTAR only; command outcomes are not a trace of physical reads.
Published by Hesela team · Updated
Report a correction · Editorial standards · Reuse guidance
Cite this page
Hesela team. Archive member. Hesela. 2026-10-18. https://hesela.dev/terms/archive-member/