On 3/24/2010 3:19 PM, Nicola wrote:
As I've said, it's essentially the example from the Iostreams doc page:
Well there are a few, so thanks for posting the specific one.
#include<fstream> #include<iostream> #include
#include #include int main(int argc, char * const argv[]) { using namespace std; using namespace boost::iostreams;
ifstream file(argv[1], ios_base::in | ios_base::binary); filtering_streambuf<input> in; in.push(bzip2_decompressor()); in.push(file); try { boost::iostreams::copy(in, cout); } catch (std::exception& e) { std::cout<< "EXCEPTION CAUGHT: "<< e.what()<< std::endl; } return 0; }
The output of the above program is
EXCEPTION CAUGHT: bzip2 error
when the argument is a “big” bzipped file (~270Mb).
I tried the above on WinXP with a big bzipped file (~315 Mb) and it worked without error. The only change I made was to copy it to an ofstream instead of cout (to prevent incessant beeping on my machine). hmmm.
The program I'm developing also fails to read the compressed file, but without errors: it just doesn't read anything. The following is a minimal self-contained excerpt that exhibits such behaviour:
I wonder if this is related to the reported problem: https://svn.boost.org/trac/boost/ticket/2411