I use CkZip C++ v220.127.116.11 in an application that runs on Windows. This application uses CkZip to store large numbers of small jpg files, so no compression.
Performance is important and so I have always used QuickAppend when adding new files to existing zip archives.
I am finding that when we use QuickAppend to add a small file (for example 2KB) file to a zip containing many (for example several thousand) similar small files, the file grows by an amount significantly larger than the added file.
I believe what is happening is that the central directory at the end of the existing zip file is large due to the high count of files in the zip. When the central directory is larger than the data being added, the new data only partially overwrites the old central directory. The new central directory is then appended to the end of the zip, leaving a large remnant of the old central directory. This repeats for each new added file, compounding the problem. We are seeing zip files that are 3 or 4 times larger than all the constituent files. This is bad for us because one of the reasons for using zip is to efficiently pack the files for optimal file-system storage.
If I have understood the problem correctly, is it possible to make QuickAppend add the new central directory to the end of the new file entry segment rather than at the end of the file? When adding a new file, the new central directory will always be larger than the previous one, ensuring that the old data is completely over-written, leaving the end of central directory record correctly at the end of the file.
Has anyone else seen this problem and found a solution?
I can supply an example zip file showing the problem if needed.
Here's a new build:
This was already fixed. Please let me know the exact build you need (MSVC++ version) or other operating system, and I will upload the latest pre-release tomorrow.
I was just checking in to see whether this had solved the issue for you. I, too was having problems just prior to this; although mine resulted in errors when unzipping. I have tested the latest Node versions, and am still seeing the problem. I guess they're related. Here's a link to that thread:
I am still using the pre-release 18.104.22.168 supplied by chilkat and this problem has not recurred for us. I have not seen any evidence of errors when unzipping so can't say for sure sure that this is the same problem that you are experiencing. Our application also uses Chilkat to unzip so I guess it copes with the dead space better than some other zip applications do.