Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ Library for modifying a ZIP file in place

Tags:

c++

zip

archive

I'm looking for a way to add or remove files to/from an existing ZIP archive, or any other archive format for that matter as long as there are cross platform APIs, without having to rewrite a new zip file with new files added to it, or sans items deleted from it.

With ZIP files, the catalog is placed at the end of the file so that, and some parts of the zip file will likely have to be rewritten each time. I'm just trying to avoid having to rewrite the whole thing every time. The archive files I'm looking at dealing with will be large, and speed is important.

Is there any C++ library out there that does what I'm looking for?

like image 550
Grant Limberg Avatar asked Feb 25 '09 01:02

Grant Limberg


2 Answers

Zipios++ provides direct access to files inside ZIP archives.

like image 75
Sparr Avatar answered Nov 15 '22 12:11

Sparr


miniz library allows you to append a file to an existing archive without rewriting it with one function call:

mz_zip_error error = MZ_ZIP_NO_ERROR;
mz_bool status = mz_zip_add_mem_to_archive_file_in_place_v2("foo.zip", "bar.txt", "Test", 4, "Comment", 7, MZ_BEST_COMPRESSION, &error);
like image 30
ScumCoder Avatar answered Nov 15 '22 11:11

ScumCoder