thejoshwolfe / yauzl

yet another unzip library for node
MIT License
703 stars 77 forks source link

Error: invalid central directory file header signature when unzipping big files, zipped by mac os #69

Closed d-mg closed 7 months ago

d-mg commented 6 years ago

Using the terminal to zip them there is no problems with unzipping. But when I use the GUI for zipping, and only with bigger files (around 8 GB and up) I get the following error:

Error: invalid central directory file header signature: 0x2d8c9fa4 at /Users/dmg_/projects/test-zipper/nodemodules/yauzl/index.js:253:70 at /Users/dmg/projects/test-zipper/nodemodules/yauzl/index.js:622:5 at /Users/dmg/projects/test-zipper/node_modules/fd-slicer/index.js:32:7 at FSReqWrap.wrapper [as oncomplete] (fs.js:658:17)

Also when running zipinfo I get:

Archive: Archive.zip Zip file size: 5946143505 bytes, number of entries: 140 warning [Archive.zip]: 4294967296 extra bytes at beginning or within zipfile (attempting to process anyway)

I did some digging through issues and some searching and I'm pretty sure these extra bytes make it that Yauzl can't find the header of the central directory.

Do you have any clue why GUI Mac OS zipped zipfiles have these extra bytes? I do see it puts some extra '__MACOSX' folders in the zip and suspect the presence of these to have something to do with it, but that's more of a guess.

overlookmotel commented 6 months ago

It looks like nothing was committed in the past 10 months.

Nothing committed because no-one has reported any bugs! If there are any new features of yauzl which you feel are important for yauzl-promise to replicate, feel free to raise an issue (or, even better, make a PR).

thejoshwolfe has been very clear that he does not intend to support faulty MacOS ZIP files, so I'd suggest if it's a problem for you (as it was for me), use yauzl-promise instead.