
On 4/23/2011 1:16 PM, Bo Jensen wrote:
On Fri, Apr 22, 2011 at 10:55 PM, eg
wrote:
/* Typedef */ typedef boost::iostreams::code_converter
convert_to_narrow_sink; int main(int argc, char *argv[]) { std::ofstream strm("test.gz");
gzip_sink gzip(strm); convert_to_narrow_sink convert(gzip);
boost::iostreams::filtering_wostreambuf wbuf(convert,100);
std::wostream wout(&wbuf);
wout<<"Hello world!"<< std::endl; }
I hope someone can make it flush correctly or say I made a simple mistake..
In the interest of closure, can you confirm (from the comment you made in another thread), that this now works for you after changing the stream open call to be: std::ofstream strm("test.gz", std::ios_base::out | std::ios_base::binary); I know that it works for me when I tried it.