Zip multiple files in C++ - c++

I have created ".tar" file and added multiple files in it while converting it to ".zip" i am facing problem.
I should create ".zip" for compress multiple files.
I need this in c++
code.BZ2 compression in C++ with bzlib.h I used this link to compress.
I tryed with http://www.winimage.com/zLibDll/minizip.html i feel its complicated.
please help me i am new to it Thank you so much in advance.

As far as I have used, Minizip is the best available open source to achieve this purpose. There are example classes, compress.c and uncompress.c which almost does everything related to zipping and unzipping

Related

c++ - Archive files present in different directories and accessing single files

I have many text files that are located in different directories -
dir1/.../textfiles/<various .txt files>
dir2/.../textfiles/<various .txt files>
and so on...
I need a c++ solution to compress and archive all these files present in different directories. I also need a way to search, decompress and open only a particular file in this archive.
One solution I can think of is to use system calls to create a tar archive.
I actually want a purely C++ based solution to this problem that is simple and fast and gives the desired result.
I searched a lot about this on the internet and found a few solutions like using Chilkat or libtar libraries but I do not intend to use them.
Another one that I found out is this.
Is there any simple C++ solution to this problem?

Free C/C++ based zip/zip64 library?

After having false starts with poco's zip and minizip (both have issues, minizip can't decompress files larger than 2gb and poco zip corrupts any zip file larger than 2 gigs it compresses) I was wondering if there was anything else left?
So any suggestions for a C++ archive library that can handle zip AND zip64?
7-zip handles both, as far as I could tell from a quick glance at their source code. It's also LGPL, which should allow its use in a closed source app.
Well there is the all-around very proven ZLIB : http://zlib.net/

Best Api to unzip a file into memory

I'm working on a Qt application where we have to read in zipped files or QByteArrays and unzip them in memory, reading the file contents without actually unzipping the file to disk.
Is there a good sdk that can enable this easily? We currently use QArchive (bugless), but we have found it to anything but bugless and are looking to move to a different solution.
Any advice is appreciated.
Thanks,
Liron
Have a look at Minizip that is included in the contrib section of zlib. It is very simple, but does the job well. More recent versions look like they handle passwords.
We ended up going with quazip. Thanks Eugen.
Seems to be working well.
Take a look at http://www.7-zip.org/sdk.html. It's licensed under public domain.

where can I find 'pkunzip.cpp and pkunzip.h"?

somewhere, I found a simple source to read something, and that source includes
"PkunZip.cpp" and "Pkunzip.h" to read zip-file.
However, I could not find the website about PkunZip.cpp ( sourceforge or codeproject etc ).
where can I find the website that describe 'pkunzip.cpp' and a manual about it?
If you search google for either of these files nothing is returned. That is a pretty bad sign. If you need code to handle zip archives, I have used libarchive in the past with great success. Their website has great documentation and the code is cross platform (Windows, *BSD, Linux, etc).
You should be able to replace any missing functionality with libarchive.
The standard way of reading zip files is zlib, or considering you tagged c++, the zipios. But if you want your particular files, have you tried Google Codesearch?

creating zip file from a folder - in c++

I want to create a program that , when executed, will compress a selected folder.
Can it be done?
If you don't want to use boost, there's also zlib, along with minizip, which is a wrapper around zlib for managing zip files.
In C++ probably the best option is to go to the Boost library. You can find it here.