LOZIPFileWrapper is a Cocoa wrapper around a modern minizip with support for extended attributes.
Features:
-
-[LOZIPFileWrapper initWithURL:]
for unzipping file based zips -
-[LOZIPFileWrapper initWithZIPData:]
for unzipping memory based zips -
-[LOZIPFileWrapper contentOfZIPFileIncludingFolders:error:]
list of filenames in the zip archive -
-[LOZIPFileWrapper contentAttributesOfZIPFileIncludingFolders:error:]
dictionary of item details like compressed size, size, encryption in the zip archive -
-[LOZIPFileWrapper contentsAtPath:error:]
NSData for item in the zip archive -
-[LOZIPFileWrapper writeContentOfZIPFileToURL:options:error:error
extract zip archive to a folder.
It requires only 10 files compared to the ~40 files of ZipZap.
- Add
LOZIPFileWrapper.h
,LOZIPFileWrapper.m
, andminizip
(required arezip.c
,zip.h
,unzip.c
,unzip.h
,ioapi.c
,ioapi.h
,ioapi_mem.c
,ioapi_mem.h
.) to your project. - Add the
libz
library to your target
macOS Archive Utilitly and ditto stores extended attributes in ZIP archives as AppleDouble. Also known as __MACOSX
folder with ._
files. LOZIPFileWrapper handles these correctly and sets them using sys/xattr.h
.
My usage just required reading zips. If somebody is intrested in write support I would suggest to start with having a look at minizip.c.
LOZIPFileWrapper is licensed under the MIT license. A version of Minizip is also included and is licensed under the Zlib license.
Thanks nmoinvaz for keeping minizip up-to-date. And to everybody in the miniunz.c copyright.