Trouble with std.zlib
Andrew Wiley
wiley.andrew.j at gmail.com
Tue Jul 19 09:08:54 PDT 2011
On Tue, Jul 19, 2011 at 7:11 AM, Jesse Phillips
<jessekphillips+D at gmail.com>wrote:
> 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).
>
I know, but if you look at the docs for the inflate functions, zlib is
supposed to be autodetecting the gzip header and uncompressing the payload
correctly, if I understand the documentation (which I probably don't at this
point).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20110719/fd959046/attachment.html>
More information about the Digitalmars-d
mailing list