marmelroy / Zip

Swift framework for zipping and unzipping files.
MIT License
2.51k stars 452 forks source link

Unzipping also returns unzipped url to a corrupted file in a __MACOSX directory #231

Open berzzani opened 2 years ago

berzzani commented 2 years ago

When unzipping a file to a directory toDir using this call:

try Zip.unzipFile(zippedFileUrl, destination: toDirUrl, overwrite: true, password: nil, progress: nil) { (url) in ... }

the closure gets called twice. First time with the url to the unzipped file in toDirUrl, so something like:

..../toDirUrl/myfile.png

the closure then gets called a second time pointing to:

..../toDirUrl/__MACOSX/._myfile.png

Problem is that ..../toDirUrl/__MACOSX/._myfile.png is no good. Image is not readable. Also, not sure why I get called to let me know that unzipped file is in ..../toDirUrl/__MACOSX/._myfile.png when I already have a good readable version of it exactly at the path I specified ..../toDirUrl.

So, now I have to special case and ignore any url pointing to the ..../toDirUrl/__MACOSX/... directory.