On Thu, 23 Jul 2009 08:40:48 +0300, Glenn Lewis <[email protected]> wrote:

If I'm not mistaken, I used to use std.zlib with DMD1, and it was compatible with gzip. Now that Andrei's awesome book is available on RoughCuts, I finally figured I would take the plunge and switch up to DMD2.

If you compare DMD1 and DMD2's zlib.d, you'll notice that the differences are trivial, and the zlib library itself hasn't changed at all, so nothing could have changed to affect this.

I tried writing a file with std.zlib.compress, and gzip could not uncompress it (both level=6 and level=9). I tried gzip'ing a file, and std.zlib.uncompress could not uncompress it (see attached D file).

What you seem to be confusing is that zlib is a compression algorithm, while gzip is a compression utility and file format. You need to add a header to zlib-compressed data.

I've attached a simple module I use to encode/decode gzip files. Hope this helps.

--
Best regards,
 Vladimir                          mailto:[email protected]

Attachment: Gzip.d
Description: Binary data

Reply via email to