std.zlib and other tools

Johannes Pfau spam at example.com
Wed Mar 2 23:53:03 PST 2011


Jesse Phillips wrote:
>I'm just wondering if anyone else has an issue with using std.zlib
>with other programs such as gzip and 7-zip? zlib creates and loads gz
>files right?
>
>The library works perfectly with itself, but I can't read or write
>compressed files from other popular programs.
>
>mport std.stdio;
>import std.file;
>import std.zlib;
>auto searchFolder = r".";
>
>void main() {
>   foreach(string de; dirEntries(searchFolder, SpanMode.shallow)) {
>      if(de[$-"gz".length..$] != "gz") {
>         auto data = read(de);
>         std.file.write(de ~ ".gz", compress(data));
>      }
>   }
>   foreach(string de; dirEntries(searchFolder, SpanMode.shallow)) {
>      if(de[$-"gz".length..$] == "gz") {
>         auto data = read(de);
>         std.file.write(de ~ ".txt", uncompress(data));
>      }
>   }
>}
I think this could be the reason:
http://zlib.net/zlib_faq.html#faq18
-- 
Johannes Pfau
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20110303/3a322a38/attachment.pgp>


More information about the Digitalmars-d-learn mailing list