Chad Scherrer wrote:

What got me thinking about this is I'd like to be able to do something
like this in just a couple lines of code:

gunzip -c ./2*/*.z

... and feed the result into a giant lazy ByteString.

Using my FileManip library, you'd do that like this.

import Codec.Compression.GZip
import qualified Data.ByteString.Lazy as B
import System.FilePath.Glob

foo :: IO B.ByteString
foo = namesMatching "*/*.gz" >>=
      fmap B.concat . mapM (fmap decompress . B.readFile)

http://hackage.haskell.org/cgi-bin/hackage-scripts/package/FileManip-0.2

        <b
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to