Reputation: 21373
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?
Upvotes: 5
Views: 5843
Reputation: 759
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);
Upvotes: 1
Reputation: 93565
Several zip libraries are available, two of the leading libraries are:
-Adam
Upvotes: 0