Acquire / archive · All operations
List the files in an archive
A variant of Unpack an archive
Read an archive as an index, one row per member with its name, size and date, without extracting it.
Status
- In arcform
Not built yet
arcform does not do this yet. Its place on the roadmap
What other tools call it
Meridian's classification; an independent blind rating agreed on 95.7% of 324 rows (variant, version 3).
VisiData (2)
tar (loader)read 2026-09-23Load tar archive as an index of its files; also filetype tbz2, tgz, txz
zip (loader)read 2026-09-23Load zip archive as an index of its files; also filetype whl
Background
A ZIP file's central directory lets a reader list the files in the archive relatively quickly, without reading the entire archive.[1] A tar archive keeps each file's metadata, such as name, size and timestamps, in a header before the file, so the archive must be read in sequence to list it.[2] DuckDB's zipfs extension adds an archive_contents table function that returns a table of the files in an archive.[3]
When to use it
Listing a tar archive with tar tf displays the names of all its files without extracting any, so problematic files can be found and left out before extraction.[2] Python's ZipFile.extractall takes an optional members argument, which must be a subset of the list ZipFile.namelist returns.[4] List an archive before unpacking it, and extract only the members a later step needs. (Meridian's view)
In Python's zipfile module, each member's ZipInfo records compress_size, the size of the compressed data, and file_size, the size of the uncompressed file.[4]
Because ZIP files may be appended to, only the files named in the central directory at the end of a ZIP file are valid.[1] The order of the file entries in a ZIP file's central directory need not match the order of the entries in the archive.[1] Python's ZipInfo.date_time returns the timestamp from the ZIP central directory, a format that cannot represent dates before 1980 and is read as local time rather than Coordinated Universal Time (UTC).[4] Treat the dates in a ZIP listing as the creator's local clock, and sort by name rather than trust the listing's order. (Meridian's view)
The method
A ZIP file is identified by an end of central directory record at the end of the archive, and each central directory entry gives a file's name, other metadata and an offset to its data.[1] The archive_contents function of DuckDB's zipfs extension can return columns such as file_name, file_size, is_directory and is_encrypted.[3]
The tar format was designed without a centralised index or table of contents, because it was meant for streaming to tape backup devices.[2] With a well-formed tar file on a seekable medium, the tar program can find a file relatively quickly by skipping file data according to the size field in each header.[2] When a tar file is compressed whole, the compression format is usually not seekable, which prevents tar from skipping through it that way.[2] Python's TarFile.getmembers returns the members of a tar archive as TarInfo objects, in the same order as the members in the archive.[5]
Sources
- [1]ZIP (file format) - Wikipediasecondary source
- [2]tar (computing) - Wikipediasecondary source
- [3]zipfs – DuckDB Community Extensionsdocumentation
- [4]zipfile — Work with ZIP archives — Python 3.15.2 documentationdocumentation
- [5]tarfile — Read and write tar archive files — Python 3.15.2 documentationdocumentation