How standard libraries read TAR files
| File | The manifest says | Go archive/tar adapter |
Go archive/tar + compress/gzip adapter |
Python tarfile adapter |
Ruby Gem::Package::TarReader adapter |
Ruby Gem::Package::TarReader + Zlib::GzipReader adapter |
Java The standard library has no tar reader: java.util.zip reads zip and gzip. |
Node.js The standard library has no tar reader. |
|---|---|---|---|---|---|---|---|---|
tar/3-text-files.tar 10.2 KB (10,240 bytes)
|
directories 0, entries 3, uncompressed_bytes 2812 |
reads reports directories 0, entries 3, uncompressed_bytes 2812 |
not given this file |
reads reports directories 0, entries 3, uncompressed_bytes 2812 |
reads reports directories 0, entries 3, uncompressed_bytes 2812 |
not given this file |
no-reader | no-reader |
tar/3-text-files.tar.gz 1.2 KB (1,152 bytes)
|
directories 0, entries 3, uncompressed_bytes 2705 |
not given this file |
reads reports directories 0, entries 3, uncompressed_bytes 2705 |
reads reports directories 0, entries 3, uncompressed_bytes 2705 |
not given this file |
reads reports directories 0, entries 3, uncompressed_bytes 2705 |
no-reader | no-reader |
tar/3-text-files.tar.xz 1.3 KB (1,268 bytes)
|
directories 0, entries 3, uncompressed_bytes 2905 |
no-reader |
no-reader |
reads reports directories 0, entries 3, uncompressed_bytes 2905 |
no-reader |
no-reader |
no-reader | no-reader |
The manifest's compression decides what each tar reader is given. python/tarfile is given the file as it is, gzip and xz included, and decompresses it itself. archive/tar (Go) and Gem::Package::TarReader (Ruby) do not decompress, so each is given only uncompressed tar, compress/gzip or Zlib::GzipReader is chained into it for gzip-compressed tar (the arrangement Go's documentation describes) under its own reader id, and for xz-compressed tar neither Go nor Ruby has a reader: Go's standard library has bzip2, flate, gzip, lzw and zlib, and no xz.
The TAR files themselves, and the measured properties each row is compared with: TAR sample files.