
24 Jun
2007
24 Jun
'07
12:35 p.m.
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