|
Boost Users : |
Subject: Re: [Boost-users] concat files for compression
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-06-15 12:54:13
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
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