GZip File Reading (std.file)

dsimcha dsimcha at yahoo.com
Sat Mar 12 15:19:59 PST 2011


Since it seems like the consensus is that streaming gzip support belongs 
in a stream API, I guess we have yet another reason to get busy with the 
stream API.  However, I'm wondering if std.file should support gzip and, 
if license issues can be overcome, bzip2.

I'd love to be able to write code like this:

// Read and transparently decompress foo.txt, which is UTF-8 encoded.
auto foo = cast(string) gzippedRead("foo.txt.gz");

// Write a buffer to a gzipped file.
gzippedWrite("foo.txt.gz", buf);

This stuff would be trivial to implement in std.file and, IMHO, belongs 
there.  What's the consensus on whether it belongs?


More information about the Digitalmars-d mailing list