max-mapper / extract-zip

Zip extraction written in pure JavaScript. Extracts a zip into a directory.
BSD 2-Clause "Simplified" License
388 stars 126 forks source link

__macosx folder #2

Open max-mapper opened 9 years ago

max-mapper commented 9 years ago

what is it and why is it in zip files. is it supposed to get ignored?

fredericrous commented 8 years ago

Basically it contains informations on the folder (icon, color, ...). On windows, kinda same thing is achieved by the hidden desktop.ini file. I would say you should keep it... or exclude the hidden desktop.ini too and provide an option to keep both.

Example: Default would be

extract(source, {dir: target}, function(err) {
 //extract all except folders __macosx and hidden desktop.ini files
})

with option

extract(source, {dir: target, force: true}, function(err) {
 //extract all and keep folders __macosx or desktop.ini
})

I called the option force but it could be keepAll or something else.

If you decide to keep the __macosx exclusion and to exclude desktop.ini too, you should really check if it's hidden. I saw there is a package called hidefile on npm with a method isHidden