|
Boost Users : |
From: asfskfdjkj kfasjfkasjf (kenatuk123_at_[hidden])
Date: 2021-03-30 13:14:33
Hi guys  I tried to unzip a file with code below which exactly like the example from boost.org, but it doesn't workÂ
the example is in the link which is Zlib Filters
|
|
| |
Zlib Filters
|
|
|
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 thoughwhat wrong I have done though? thank you
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