streamly-zip

Please see the README on GitHub at https://github.com/shlok/streamly-zip#readme


Keywords
bsd3, codec, library, streaming, streamly, Propose Tags, https://github.com/shlok/streamly-zip#readme, Skip to Readme, Index, Quick Jump, Streamly.External.Zip, Streamly.External.Zip.Internal, Streamly.External.Zip.Internal.Error, Streamly.External.Zip.Internal.Foreign, streamly-zip-0.0.1.tar.gz, browse, Package description, Package maintainers, shlok, edit package information , 0.0.1, streamly-archive
License
BSD-3-Clause
Install
cabal install streamly-zip-0.0.1

Documentation

streamly-zip

Stream data from zip archives using the Haskell streamly library.

Comparison with streamly-archive

This library was created because libarchive (which streamly-archive relies on) does not seem to have support for jumping to specific files even when the format supports it.

Requirements

Install libzip on your system.

  • Debian Linux: sudo apt-get install libzip-dev.
  • macOS: brew install libzip.

Quick start

module Main where

import qualified Data.ByteString as B
import Data.Function
import qualified Streamly.Data.Fold as F
import qualified Streamly.Data.Stream.Prelude as S
import Streamly.External.Zip

main :: IO ()
main = do
  -- Obtain an archive.
  z <- openZip "/path/to/archive.zip" []

  -- Output a particular file to stdout.
  S.unfold unfoldFileAtPath (z, [], "file.txt")
    & S.mapM B.putStr
    & S.fold F.drain