Hi guys
I tried to unzip a file with code below which exactly like the example from boost.org, but it doesn't work
I tried the code like the below
try
{
ifstream file("d:\\202012303333629003180526491.txt.zip", ios_base::in | ios_base::binary);
boost::iostreams::filtering_streambuf<boost::iostreams::input> in;
in.push(boost::iostreams::zlib_decompressor());
in.push(file);
boost::iostreams::copy(in, cout);
return 0;
}
catch (const std::exception& error)
{
std::cerr << error.what() << std::endl;
return (EXIT_FAILURE);
}
it's not working, it get exception when it excuted boost::iostreams::copy(in, cout);
I got the zlib error: iostream stream error exception though
what wrong I have done though? thank you