On Tue, Jul 19, 2011 at 7:11 AM, Jesse Phillips <jessekphillip...@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).