HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulezip-archive-0.4.3.2Haskell98

Codec.Archive.Zip

The zip-archive library provides functions for creating, modifying, and extracting files from zip archives.

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.

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

For more information on the format of zip archives, consult http://www.pkware.com/documents/casestudies/APPNOTE.TXT

  • 6 types
  • 20 values

Data structures

7 declarations
datadata Archive
#

Structured representation of a zip archive, including directory information and contents (in lazy bytestrings).

Constructors

Instances3Read, Show, Binary
  • Read ArchiveDefined in zip-archive-0.4.3.2 · Codec.Archive.Zip
  • Show ArchiveDefined in zip-archive-0.4.3.2 · Codec.Archive.Zip
  • Binary ArchiveDefined in zip-archive-0.4.3.2 · Codec.Archive.Zip
datadata Entry
#

Representation of an archived file, including content and metadata.

Constructors

Instances3Eq, Read, Show
  • Eq EntryDefined in zip-archive-0.4.3.2 · Codec.Archive.Zip
  • Read EntryDefined in zip-archive-0.4.3.2 · Codec.Archive.Zip
  • Show EntryDefined in zip-archive-0.4.3.2 · Codec.Archive.Zip
datadata ZipOption
#

Constructors

Instances3Eq, Read, Show
  • Eq ZipOptionDefined in zip-archive-0.4.3.2 · Codec.Archive.Zip
  • Read ZipOptionDefined in zip-archive-0.4.3.2 · Codec.Archive.Zip
  • Show ZipOptionDefined in zip-archive-0.4.3.2 · Codec.Archive.Zip

Pure functions for working with zip archives

14 declarations

Like toArchive, but returns an Either value instead of raising an error if the archive cannot be decoded. NOTE: This function only works properly when the library is compiled against binary >= 0.7. With earlier versions, it will always return a Right value, raising an error if parsing fails.

valuetoEntry
  1. :: FilePath

    File path for entry

  2. -> Integer

    Modification time for entry (seconds since unix epoch)

  3. -> ByteString

    Contents of entry

  4. -> Entry
#

Create an Entry with specified file path, modification time, and contents.

IO functions for working with zip archives

5 declarations

Extract all files from an Archive, creating directories as needed. If OptVerbose is specified, print messages to stderr. Note that the last-modified time is set correctly only in POSIX, not in Windows. This function fails if encrypted entries are present