Certain simplifying assumptions are made about the zip archives:
in particular, there is no support for strong encryption, zip
files that span multiple disks, ZIP64, OS-specific file
attributes, or compression methods other than Deflate. However,
the library should be able to read the most common zip archives,
and the archives it produces should be readable by all standard
unzip programs.

Archives are built and extracted in memory, so manipulating
large zip files will consume a lot of memory. If you work with
large zip files or need features not supported by this library,
a better choice may be zip,
which uses a memory-efficient streaming approach. However, zip
can only read and write archives inside instances of MonadIO, so
zip-archive is a better choice if you want to manipulate zip
archives in “pure” contexts.

As an example of the use of the library, a standalone zip archiver
and extracter is provided in the source distribution.

Changes

zip-archive 0.4

* Implement read-only support for PKWARE encryption (Sergii Rudchenko). The "traditional" PKWARE encryption is a symmetric encryption algorithm described in zip format specification in section 6.1. This change allows to extract basic "password-protected" entries from ZIP files. Note that the standard file extraction function extractFilesFromArchive does not decrypt entries (it will raise an exception if it encounters an encrypted entry). To handle archives with encrypted entries, use the new function fromEncryptedEntry.

* Add UnsafePath to ZipException (#50). * writeEntry: raise UnsafePath exception for unsafe paths (#50). This prevents malicious zip files from overwriting paths above the working directory. * Add Paths_zip_archive to autogen-modules. * Clarify README and cabal description. * Specify cabal-version: 2.0. Otherwise we get an unknown build tool error using `build-depends` without a custom Setup.hs. * Change build-type to simple. Retain 'build-tools: unzip' in test stanza, though now it doesn't do anything except give a hint to external tools. If unzip is not found in the path, the test suite prints a message and counts the test that requires unzip as succeeding (see #51).

* Move 'build-tools: unzip' from library stanza to test stanza. unzip should only be required for testing, not for regular builds of the library.

zip-archive 0.3.2.4

* Make build-tools stanza conditional on non-windows. Closes #44.

zip-archive 0.3.2.3

* Use custom-setup stanza and specify build-tools. Closes #41.

zip-archive 0.3.2.2

* Use createSymbolicLink instead of createFileLink in tests. This allows us to lower the directory lower bound (#40).

zip-archive 0.3.2.1

* Fixes for handling of symbolic links (#39, Tommaso Piazza).

* Fixes for symbolic link tests, and additional tests.

zip-archive 0.3.2

* Add ZipOption to preserve symbolic links (#37, Tommaso Piazza). Add OptPreserveSymbolicLinks constructor to ZipOption. If this option is set, symbolic links will be preserved. Symbolic links are not supported on Windows.

* Require binary >= 0.6 (#36).

* Improve exit handling in zip-archive program.

zip-archive 0.3.1.1

* readEntry: Read file as a strict ByteString. This avoids problems on Windows, where the file handle wasn't being closed. * Added appveyor.yml to do continuous testing on Windows. * Test suite: remove need for external zip program (#35). Instead of creating an archive with zip, we now store a small externally created zip archive to use for testing.

* Fix bug in `OptLocation` handling (EugeneN). When using `OptLocation folder False` (for adding files to an archive into a folder without preserving full path hierarchy), original files' names were ignored, resulting in all the files getting the same name.

zip-archive 0.3.0.4

* Fix `toArchive` so it doesn't use too much memory when a data data descriptor holds the size (Michael Stahl, #29). The size fields in the local file headers may not contain valid values, in which case the sizes are stored in a "data descriptor" that follows the file data. Previously handling this case required reading the entire archive is a `[Word8]` list. With this change, `getWordsTilSig` iteratively reads chunks as strict ByteStrings and converts them to a lazy ByteString at the end.

zip-archive 0.3.0.3

* Test suite: use withTempDir to create temporary directory. This should help fix problems some have encountered with the test suite leaving a temporary directory behind.

zip-archive 0.3.0.2

* Fix test suite so it runs on Windows. * Zip executable: get version from cabal `Paths_zip_archive` (#27).

zip-archive 0.3.0.1

* Set `eVersionMadeBy` to 0 (default) in `toEntry`, since we are setting external attributes to 0. See jgm/pandoc#2822. Only to `eVersionMadeBy` to UNIX if we actually read file attributes on a UNIX system.

zip-archive 0.3

* Support preservation of file modes on Posix (Dan Aloni, #26). * Add `eVersionMadeBy` field to `Entry` (API change). * Export `ZipException` (API change). * `fromEntry` no longer checks for CRC32 match. Previously, it issued `error` if the match failed. CRC32 match is now checked in `writeEntry` instead, and a `CRC32Exception` is raised if the checksum doesn't match. * Test suite: return nonzero status if there are test failures. Previously we mistakenly did this only on 'errors', not failures. * Test suite: don't use -9 with zip as it isn't always available. * Use .travis.yml that builds on both stack and cabal.

* Allow compilation with binary >= 0.5. Note that toArchiveOrFail is not safe when compiled against binary < 0.7; it will never return a Left value, and will raise an error if parsing fails, just like toArchive. This is documented in the haddocks. This is ugly, but justified by the need to have a version of zip-archive that compiles against older versions of binary.

* Require binary >= 0.7 and directory >= 1.2. The newer binary is needed to provide toArchiveOrFail. The other change is mainly for convenience, to avoid lots of ugly conditional compilation.

zip-archive 0.2.3

* Export new function `toArchiveOrFail`. Closes #17. * Set general purpose bit flag to use UTF8 in local file header. Otherwise we get a mismatch between the flag in the central directory and the flag in the local file header, which causes some programs not to be able to extract the files. Closes #19.