schveiguy / iopipe

D language library for modular io
Boost Software License 1.0
77 stars 6 forks source link

Just a Question: gunzip/gzip #6

Closed EmTee70 closed 6 years ago

EmTee70 commented 7 years ago

It is really a newbie question, before examining the coding in more detail, would it be easy to use gunzip/gzip in spite off unzip/zip? Like mentioned here: http://www.digitalmars.com/d/archives/digitalmars/D/Read_and_write_gzip_files_easily._224433.html

schveiguy commented 7 years ago

Yes, iopipe supports both gzip and normal zip (if that is your question). It uses etc.c.zlib, which is from here: https://zlib.net/

Using iopipe to do gzip/unzip is pretty straightforward:

// filestream is an iopipe with a ubyte[] window that can be further processed as needed
auto filestream = openDev("myfile.gz").bufd.unzip;

I am about to publish the docs, so this will be clearer soon.

schveiguy commented 7 years ago

Docs are now online: http://schveiguy.github.io/iopipe

schveiguy commented 7 years ago

Specifically, have a look here: http://schveiguy.github.io/iopipe/iopipe/zip.html

Note, there isn't a good documented example yet.