Hello all, I'm newbie to boost::iostreams library. I'm trying to unzip a .zip file. for that I'm using iostream's zlib_decompressor class to inflate it. I'm using the sample code provided in the documentation. What I was getting is an exception (zlib error). My question is can i use boost::iostreams classes for unzipping a .zip file.? If so how? a small sample snippet would be helpful. Thanks in advance, Surya
Hi, Surya Kiran Gullapalli skrev:
Hello all, I'm newbie to boost::iostreams library.
I'm trying to unzip a .zip file. for that I'm using iostream's zlib_decompressor class to inflate it. I'm using the sample code provided in the documentation. What I was getting is an exception (zlib error).
My question is can i use boost::iostreams classes for unzipping a .zip file.? If so how? a small sample snippet would be helpful.
A .zip file is actually a collection of zlib compressed files, so you cannot use zlib_decompressor directly on the zip file, but you have to extract the files within the zip file first, then decompress them. But how to do that, I don't know (in boost context). But there are plenty of zip archive libs around, f.i. http://www.artpol-software.com/ZipArchive/Default.aspx . I wouldn't be surprised though if there is a boost way of doing this... /Rob
Surya Kiran Gullapalli wrote:
Hello all, I'm newbie to boost::iostreams library.
I'm trying to unzip a .zip file. for that I'm using iostream's zlib_decompressor class to inflate it. I'm using the sample code provided in the documentation. What I was getting is an exception (zlib error).
My question is can i use boost::iostreams classes for unzipping a .zip file.? If so how? a small sample snippet would be helpful.
Thanks in advance, Surya
zlib and zip are different archive file formats. The iostreams zlib_[de]compressor [reads]writes data using the ZLIB format (http://www.ietf.org/rfc/rfc1950.txt). Whereas the zip file format is a different format. See: http://www.pkware.com/business_and_developers/developer/appnote/ You can use zlib_[de]compressor to implement your own zip file archiver, but you will have to code this yourself as it is not included in the iostreams library at this time.
participants (3)
-
eg
-
Robert Bielik
-
Surya Kiran Gullapalli