AMDG Kraus Philipp wrote:
Thanks that was a very big hint.
My code is now:
bio::basic_null_sink<char> l_out; bio::counter l_counter; bio::filtering_streambuf< bio::output > l_deflate;
l_deflate.push( bio::gzip_compressor() ); l_deflate.push( boost::ref(l_counter) ); l_deflate.push( l_out );
std::ifstream l_file( p_str1.c_str(), std::ifstream::in | std::ifstream::binary ); bio::copy( l_file, l_deflate ); l_file.close();
l_file.open( p_str2.c_str(), std::ifstream::in | std::ifstream::binary ); ===> bio::copy( l_file, l_deflate ); <==== error l_file.close();
It works perfectly, except the second copy. On this line I get a "segmentation fault" (sorry I can't use the debugger, because the code runs on another system).
I'm guessing that the problem is that copy closes the sink. In Christ, Steven Watanabe