zip-stream-0.2.0.1: ZIP archive streaming using conduits

Safe HaskellNone
LanguageHaskell2010

Codec.Archive.Zip.Conduit.UnZip

Description

Stream the extraction of a zip file, e.g., as it's being downloaded.

Synopsis

Documentation

unZipStream :: (MonadThrow m, PrimMonad m) => ConduitM ByteString (Either ZipEntry ByteString) m ZipInfo Source #

Stream process a zip file, producing a sequence of entry headers and data blocks. For example, this might produce: Left (ZipEntry "directory/" ...), Left (ZipEntry "directory/file.txt" ...), Right "hello w", Right "orld!\n", Left ... The final result is summary information taken from the end of the zip file. No state is maintained during processing, and, in particular, any information in the central directory is discarded.

This only supports a limited number of zip file features, including deflate compression and zip64. It does not (ironically) support uncompressed zip files that have been created as streams, where file sizes are not known beforehand. Since it does not use the offset information at the end of the file, it assumes all entries are packed sequentially, which is usually the case. Any errors are thrown in the underlying monad (as ZipErrors or ParseError).

data ZipEntry Source #

(The beginning of) a single entry in a zip stream, which may be any file or directory. As per zip file conventions, directory names should end with a slash and have no data, but this library does not ensure that.

Constructors

ZipEntry 

Fields

Instances
Eq ZipEntry Source # 
Instance details

Defined in Codec.Archive.Zip.Conduit.Types

Show ZipEntry Source # 
Instance details

Defined in Codec.Archive.Zip.Conduit.Types

data ZipInfo Source #

Summary information at the end of a zip stream.

Constructors

ZipInfo 
Instances
Eq ZipInfo Source # 
Instance details

Defined in Codec.Archive.Zip.Conduit.Types

Methods

(==) :: ZipInfo -> ZipInfo -> Bool #

(/=) :: ZipInfo -> ZipInfo -> Bool #

Show ZipInfo Source # 
Instance details

Defined in Codec.Archive.Zip.Conduit.Types