MonoTouch bindings for ZipArchive. Compress files in your iPhone app with MonoTouch.
Switch branches/tags
Nothing to show
Latest commit cdfb038 Mar 7, 2011 @ayoung ayoung Updated usage examples.
Failed to load latest commit information.
Makefile Initial commit. Mar 5, 2011 Updated usage examples. Mar 7, 2011
libziparchive.a Initial commit. Mar 5, 2011
monotouch-ziparchive.dll Initial commit. Mar 5, 2011
ziparchive.cs Initial commit. Mar 5, 2011

Monotouch bindings for ZipArchive

This library allows you to easily compress files to an archive (.zip file) using MonoTouch. Other libraries are available but this is one of the simplest solutions.

You can get the ZipArchive code from their google code page.

Adding this lib to your project

  • Copy libziparchive.a and monotouch-ziparchive.dll to the root of your proj. You can copy it to another relative location but you'll have to modify the gcc_flags specified down below to match the paths.
  • In your MonoTouch project options > iPhone Build
    • Set Linker behavior to "Link SDK assemblies only"

    • Set the Extra arguments in all iPhone Build configurations to:

      -v -gcc_flags "-L${ProjectDir} -lziparchive -lz.1.2.3 -framework Foundation -force_load ${ProjectDir}/libziparchive.a"

      This includes build configs for Debug and Release versions of iPhone and iPhoneSimulator configs.


To zip files:

  var zipFile = new LibZipArchive.ZipArchive();
  zipFile.AddFile("/path/of/file/to/compress.txt", "somefile.txt");
  // add more files as needed

To unzip files:

  var zipFile = new LibZipArchive.ZipArchive();
  zipFile.UnzipFileTo("/location/to/unarchive", true);