P
peter.j.torelli
Hello,
I use Compress::Zlib extensively for reading files, but I always run
into this problem when writing:
If the user does not want to write compressed output, I can't use
Compress::Zlib for writing. I tried all the Zlib options to turn off
compression, and it always inserts a binary header, even with no
compression.
Since the read/write/close methods for the object are not the same as
an uncompressed filehandle, I can't just use a different open method
for the same variable. Instead I end up having to use open() and a
pipe to gzip if compression is desired so that the same filehandle can
be used without a ton of conditionals in the code.
So the simple question is: how do I turn off all compression and
headers when I use gzopen() and just write a plain text file?
(Note: I already played with Compress::Zlib::Z_NO_COMPRESSION, and
-WindowBits=>-MAX_WBITS, as well as "w" vs. "wb".)
Thanks,
Peter
I use Compress::Zlib extensively for reading files, but I always run
into this problem when writing:
If the user does not want to write compressed output, I can't use
Compress::Zlib for writing. I tried all the Zlib options to turn off
compression, and it always inserts a binary header, even with no
compression.
Since the read/write/close methods for the object are not the same as
an uncompressed filehandle, I can't just use a different open method
for the same variable. Instead I end up having to use open() and a
pipe to gzip if compression is desired so that the same filehandle can
be used without a ton of conditionals in the code.
So the simple question is: how do I turn off all compression and
headers when I use gzopen() and just write a plain text file?
(Note: I already played with Compress::Zlib::Z_NO_COMPRESSION, and
-WindowBits=>-MAX_WBITS, as well as "w" vs. "wb".)
Thanks,
Peter