You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Mac Archive Utility fails on zip with empty directories #558
When zipping a folder that contains empty folders using this code:
const zipFile = fs.existsSync(filePath) ? new AdmZip(filePath) : new AdmZip();
zipFile.addLocalFolder(folderPathToZip);
zipFile.writeZip(filePath);
The ZIP file cannot be unzipped by Mac OS's "Archive Utility" app used by "Finder" to unzip ZIP files.
It works command line using the "zip" command and it works with "The Unarchiver" app.
It fails with "Error 79 - Inappropriate file type or format" in "Archive Utility".
"adm-zip": "0.5.10"
Mac OS Sequioa 15.5 (24F74)
zip --version
Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
This is Zip 3.0 (July 5th 2008), by Info-ZIP, with modifications by Apple Inc.
Compiled with gcc Apple LLVM 17.0.0 (clang-1700.0.13.5) [+internal-os] for Unix (Mac OS X) on Apr 18 2025.
I can reproduce this on my machine — and in my case Archive Utility didn't
just throw "Error 79", it quit unexpectedly when opening a zip that
contained an empty directory.
Environment
MacBook Air (M3), macOS 26.5.1 (build 25F80)
adm-zip 0.5.17, Node v22.11.0
Root cause: the method setter in headers/entryHeader.js is missing a break, so the switch falls through and sets "version needed to extract = 2.0"
for all entries — including STORED ones (every directory and empty file).
Info-ZIP writes 1.0 for stored entries, and Archive Utility rejects the 2.0
directory entries.
After applying the fix, stored/directory entries correctly report v1.0, the
archive opens normally in Archive Utility, and the full test suite still passes
— no longer reproducible on my machine.
Activity
JohnJunior commentedon Jun 17, 2026
I can reproduce this on my machine — and in my case Archive Utility didn't
just throw "Error 79", it quit unexpectedly when opening a zip that
contained an empty directory.
Environment
Root cause: the
methodsetter inheaders/entryHeader.jsis missing abreak, so the switch falls through and sets "version needed to extract = 2.0"for all entries — including STORED ones (every directory and empty file).
Info-ZIP writes 1.0 for stored entries, and Archive Utility rejects the 2.0
directory entries.
After applying the fix, stored/directory entries correctly report v1.0, the
archive opens normally in Archive Utility, and the full test suite still passes
— no longer reproducible on my machine.
I opened a PR with the one-line fix: #563
Would appreciate a review 🙏 /cc @cthackers
Fix Archive Utility failure on zips with empty directories (#558)
Merge pull request #563 from JohnJunior/fix/empty-dir-version