
"George M. Garner Jr." <gmgarner@erols.com> wrote in message news:chvo31$nlc$1@sea.gmane.org...
Johnathan,
Dumb question - is Winzip supposed to be able to read the zlib format? I usually use it to decompress .zip or tar.gz archives. <
Well I made that assumption because Winzip and XP both maintain associations for the .z extension. This is from the Winzip help file:
Since almost all new archives are created in Zip format, WinZip does not provide facilities to add to or create files in these formats (however, all other WinZip functions are supported). <
I tried compressing some data using the zlib utility function compress, sidestepping that the iostreams library entirely. To my relief, WinZip couldn't read these files either. So whatever the problem is, it doesn't seem to be in the iostreams layer. Also, gzip is just a thin wrapper around zlib, and I have been able to use WinZip to unzip files compressed with the gzip_compressor.
Thanks. It took me a long time to get this to work with my sample data, but since I tried only a few samples, I guess I'm not surprised it's still wrong. Somehow, though, I seem to remember "|| eof" failing, too.
You're welcome to the sample project if you like. The problem is that, with the bzip2 sample, eof is reached and next_s != end_s. That may be a bug in itself however I don't think that you can rely on this condition always being true at eof. You also would enter the infinite loop by trying to read a malformed zlib or gzip archive, for example. When eof is reached you have to be "done."
This sounds right. Anyway, the regression tests pass with your fix, so all seems to be well. Thanks! Best Regards, Jonathan