marmelroy/Zip

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

berzzani opened this issue · 0 comments

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.