Go to file
Sam Soffes c05ee25f7f Fixes for unzipping modification dates and add ARC support
* Add ARC support
* Fixes: One of the bugs is that the file modification dates for files being unzipped were wrong. Apparently the code was taking the MS-DOS date and time and treating it as an NSTimeInterval since Jan 1, 1980. This is not correct and was resulting in modification dates for me in 2014. — Brant Sears
* Fixes: The second bug was that the file modification dates for folders were showing up as the current date/time, but when I unzip the same archive using Apple's implementation of zip, the file modification dates for those folders were set sometime in the past. — Brant Sears
2012-05-07 22:27:45 -07:00
minizip Upgrade to minizip 1.1 2011-10-31 17:08:41 -07:00
Tests Fix warnings 2012-05-07 22:12:09 -07:00
.gitignore Added basic tests and changelog 2011-10-03 23:28:54 -07:00
Changelog.markdown 0.1.2 release 2011-12-26 23:33:44 -05:00
LICENSE Updated license 2011-06-22 10:41:36 -07:00
Readme.markdown Updated readme 2011-12-26 23:38:42 -05:00
SSZipArchive.h Dont't import "minizip/zip.h" in the header file 2011-12-27 17:15:40 +01:00
SSZipArchive.m Fixes for unzipping modification dates and add ARC support 2012-05-07 22:27:45 -07:00

SSZipArchive

SSZipArchive is a simple utility class for zipping and unzipping files. Features:

  • Unzipping zip files
  • Unzipping password protected zip files
  • Creating zip files
  • Appending to zip files
  • Zipping files
  • Zipping NSData with a filename

Adding to your project

  1. Add SSZipArchive.h, SSZipArchive.m, and minizip to your project.
  2. Add the libz library to your target

Usage

// Unzipping
NSString *zipPath = @"path_to_your_zip_file";
NSString *destinationPath = @"path_to_the_folder_where_you_want_it_unzipped";
[SSZipArchive unzipFileAtPath:zipPath toDestination:destinationPath];

// Zipping
NSString *zippedPath = @"path_where_you_want_the_file_created";
NSArray *inputPaths = [NSArray arrayWithObjects:
                       [[NSBundle mainBundle] pathForResource:@"photo1" ofType:@"jpg"],
                       [[NSBundle mainBundle] pathForResource:@"photo2" ofType:@"jpg"]
                       nil];
[SSZipArchive createZipFileAtPath:zippedPath withFilesAtPaths:inputPaths];

License

SSZipArchive is licensed under the MIT license. A slightly modified version of Minizip 1.1 is also included and is licensed under the Zlib license.

Thanks

Thanks aish for creating ZipArchive which SSZipArchive is based on, Johnnie Walker (@randomsequence) for implementing creation support, and John Engelhart (@johnezang) for all his amazing help along the way.