Boost logo

Boost Users :

Subject: Re: [Boost-users] [iostreams] bzip2 filter fails with large file on Xen system
From: eg (egoots_at_[hidden])
Date: 2010-03-25 03:45:53


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<boost/iostreams/filtering_streambuf.hpp>
> #include<boost/iostreams/copy.hpp>
> #include<boost/iostreams/filter/bzip2.hpp>
>
> 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


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