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.

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).

Note that writing with std.zlib then later reading with std.zlib works just 
fine... but am I dreaming that I used to also be able to use 'gzip' on the 
resulting files?

Thanks!
-- Glenn Lewis

// testzlib.d
// Usage: testzlib file.txt.gz

module testzlib;

import std.stdio;
import std.file;
import std.zlib;

void main(string[] args)
{
  foreach (arg; args[1..$])
  {
    string buf = cast(string)std.file.read(arg);
    string outbuf = cast(string)uncompress(buf);
    writeln(outbuf);
  }
}

// Local-variables:
// compile-command: "dmd testzlib.d"
// End:

Reply via email to