Adding a new entry to an existing zip file.
The documentation of Zip.open_out suggests that opening an existing zip file to add new entries will truncate it to zero length. As far as i'm aware, zip files allow adding new entries. Is there a way to add an entry to an existing zip file using this library without copying all existing entries to a temporary directory then adding them to a new empty zip together with the new entry?
You're correct that the Camlzip library currently does not support adding new entries to an existing ZIP file. You can, however, create a new ZIP file, copy all entries from the old ZIP file to the new ZIP file, then add the new entries.
I'll leave this issue open as a feature wish for future Camlzip development.
Implemented Zip.open_update in f85582b. Will be released in version 1.13, it should support the use case mentioned here.
Implemented
Zip.open_updatein f85582b. Will be released in version 1.13, it should support the use case mentioned here.
Thank you for the quick update. I tried it and it works well.