Deleteing files

Sep 16, 2009 at 3:05 PM
Please forgive me if I am asking a stupid question but am I right in saying that in order to remove data (stored file / stream) from the zip file, I would have to create a new zip file and copy over the data (minus the deleted file). I can see this working for small files but for large zip files containing many files it's going to be very slow. Can you suggest an alternative?
Sep 16, 2009 at 3:36 PM

Hi dtubb,

Thanks for writting.

The intention of this library is to provide a very simple mechanism for applications to produce zipped outputs and eventually read them again. It is not a 100% featured library. Deletion can be done just as you described (write the zip again). Deleting a file without regenerating the zip file is possible but will be almost the same in terms of performance. At least you will need to:

  • Locate file position inside zip.
  • Copy all following files from its current position overwritting the deleted file data.
  • Rewrite all the central directory because file positions have been changed

This operation will represent, in best case, an average of 50% of time-savings w.r.t. the traditional way (write all file again).

Anyway, if you still find this library useful, please vote for it.

Thanks and best regards,


Sep 16, 2009 at 5:47 PM

ok thanks Jamie, and yes i have found this extremely useful.

thanks again


Sep 29, 2009 at 6:56 AM

Hi Dan,

I have released a new version with Remove capability, among other new features.

Best regards,