Boost logo

Boost Users :

From: Christian Henning (chhenning_at_[hidden])
Date: 2005-11-16 11:03:58


When I use this little test program, taken from the zlib examples.
WinRar doesn't have any problem opening it. The generated file
"chh.gz" is 26 bytes.

int main()
{
   gzFile file;

   file = gzopen( "chh.gz", "wb");

   gzputc(file, 'h');
   gzputs(file, "ello" );

   gzseek(file, 1L, SEEK_CUR); /* add one zero byte */

   gzclose(file);

   return 0;
}

Using the iostreams I think, and I might be wrong, should generate the
same file using this test program:

int main()
{
   io::filtering_ostream out;
   out.push( io::zlib_compressor() );
   out.push( io::file_sink( "chh.gz", std::ios::binary ));

   out << "hello";

   return 0;
}

Here the file is 13 bytes. So I guess the header or footer is wrong.

Greets,
Christian


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net