Haskell threads & pipes & UNIX processes

Michael Marte marte@pms.informatik.uni-muenchen.de
Fri, 16 Feb 2001 12:16:51 +0100 (CET)


Hello Marcin,

> Thu, 15 Feb 2001 08:50:41 -0800, Julian Seward (Intl Vendor) <v-julsew@microsoft.com> pisze:
> 
> > use the foreign import mechanism to make BZ2_bzopen,
> > BZ2_bzwrite and BZ2_bzclose available in your program.
> 
> bzlib and zlib wrappers are available in
> <http://www.sourceforge.net/projects/qforeign/>
> (for ghc >= 4.08 and nhc98 >= 1.02).
> 
> bzlib does not have this problem: its in-memory compressed data is
> identical to .bz2 file contents.
> 
> Both wrappres include functions for lazy compression and decompression
> of strings (String -> String).

The wrapper works fine, except for - when bunzipping a file -
bunzip complains like this:

bunzip: wbg-5-11-0.xml.bz2: trailing garbage after EOF ignored

Indeed, the file produced by the Haskell program is one byte longer
than the file produced by bzip (called from the command line).

Michael