Check empty folders and file bytes after ZIP conversion
Admin ·
When a system expects TAR.GZ, check the directory tree as well as the file bytes after converting. An empty folder is easy to miss if you only compare the number of regular files.
Convert a ZIP with an explicit empty directory
Choose Load example to select the fieldwork ZIP. It contains empty/, briefing/route.txt, data/café.csv and data/sample.bin.
Keep compression level 6 and choose Convert to TAR.GZ. Download converted.tar.gz and open it in TAR.GZ Extractor. Confirm that empty/ remains and briefing/ and data/ are present as parent directories.
Download the fieldwork example ZIPPOSIX pax interchange archive formats
Compare an accented path and a binary file
Check the spelling of data/café.csv. Download data/sample.bin from the TAR and check that it contains 320 bytes. Its first eight bytes in hexadecimal are 00 01 02 03 04 05 06 07.
To check every byte, extract the same binary member from the source ZIP and compare its checksum with the extracted TAR member. Repeat at GZIP compression level 1 to see that the encoding can change while the member bytes remain the same.
Download the fieldwork example ZIPRFC 1952 GZIP specification
Review archive and reader compatibility
The output places regular entries in TAR headers and stores long paths in PAX extensions where needed. Confirm that your intended TAR reader understands PAX when you use long names.
If an input archive is blocked because it contains a link, unsafe path or unsupported encoding, create a new source ZIP with regular files and folder entries you intend to distribute.
PKWARE ZIP specificationPOSIX pax interchange archive formats
Common questions
Why might the TAR show more entries than the ZIP?
The writer can add directory headers for file parents. The supplied fieldwork ZIP has four entries and its TAR result has six, including the two parent folders.
Does a converted archive retain ownership or executable bits?
The output retains supported paths, directories and file bytes. It uses ordinary TAR permissions and does not preserve ownership or executable bits from the ZIP.