Extract compressed file with boost :: iostreams

I am looking for a way to extract a file in C ++ using boost :: iostreams classes.

The additional documentation has an example . But it outputs the contents of the compressed file to std :: cout. I am looking for a way to extract it into a file structure.

Does anyone know how to do this?

Thanks!

+4
source share
4 answers

Boost.IOStreams does not support compressed archives, but only individual compressed files. If you want to extract a .zip or .tar file into a directory tree, you will need to use a different library.

+5
source

An example in the documentation shows how to unzip a file and push the result to another stream.

If you want the output to be directed to an array in memory, you can use a stream like boost::iostreams::stream<boost::iostreams::array_source> .

This is basically a streaming wrapper around an array.

I'm not sure what you mean when you say you want to output in a "file structure".

+2
source

It seems to me that calling boost :: iostreams :: copy takes the second stream as the second parameter. Have you tried to create a stream from your output file and use it?

+1
source

You probably don't want this library. You might want to look around for others.

eg. zziplib

+1
source

All Articles