Trouble with std.zlib

Jesse Phillips jessekphillips+D at gmail.com
Tue Jul 19 07:11:12 PDT 2011


Andrew Wiley Wrote:

> I'm using std.zlib in an application, and I'm having trouble decompressing a
> file. The file is gzipped, and I can easily see the contents with `cat file
> | gzip -d` but this code doesn't work:
> auto arr = read("file.gz");
> ubyte[] realarr = cast(ubyte[])uncompress(arr);

The zlib format is different from the gzip format.

http://www.zlib.net/zlib_faq.html#faq18

One is made for file storage and the other internal data transfer. D does not provide a wrapper to the gzip functions at this time but they are available in std.c.zlib (with the C interface).


More information about the Digitalmars-d mailing list