Quantcast
Channel: Chilkat Forum - latest questions
Viewing all articles
Browse latest Browse all 1061

CkZip and QuickAppend

$
0
0

I use CkZip C++ v9.5.0.58 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.


Viewing all articles
Browse latest Browse all 1061

Trending Articles