Tried to unzip a file , and followed the example in the boost.org as well, but it doesn't work

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Tried to unzip a file , and followed the example in the boost.org as well, but it doesn't work

Boost - Users mailing list
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 <img class="TSRWebRatingIcon" src="chrome-extension://ohhcpmplhhiiaoiddkfboafbhiknefdf/images/tooltip/webicon_green.png" data-inlineimagemanipulating="true" style="width: 16px; height: 16px; border: 0px;">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 though
what wrong I have done though? thank you

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Tried to unzip a file , and followed the example in the boost.org as well, but it doesn't work

Boost - Users mailing list
asfskfdjkj kfasjfkasjf via Boost-users wrote:
> Hi guys
>     I tried to unzip a file with code below which exactly like the
> example from boost.org, but it doesn't work

Hi,
I the case you are not the 'ken' here:
<https://stackoverflow.com/questions/66867644/tried-to-decompress-a-zip-file-into-memory-with-boost-but-it-doesnt-work>

I addressed the reason in the comment below the question.
Best, Dan.

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Tried to unzip a file , and followed the example in the boost.org as well, but it doesn't work

Boost - Users mailing list

yeah, it was me,lol 
On Thursday, April 1, 2021, 11:56:53 PM GMT+8, Dan Bloomquist via Boost-users <[hidden email]> wrote:


asfskfdjkj kfasjfkasjf via Boost-users wrote:
> Hi guys
>     I tried to unzip a file with code below which exactly like the
> example from boost.org, but it doesn't work


Hi,

I the case you are not the 'ken' here:
<https://stackoverflow.com/questions/66867644/tried-to-decompress-a-zip-file-into-memory-with-boost-but-it-doesnt-work>

I addressed the reason in the comment below the question.
Best, Dan.

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users