Closed alexander-williamson closed 8 years ago
I'm working mobile right now, so please pardon my brevity. Basically, you have to create a new archive based on the content of the old one and then replace the old archive with the new one. There's no way to perform deletions or replacements in place.
You should be able to copy the entries from the old archive directly, removing or replacing entries as needed, without the need to extract them. It's been a while since I was in the code, but I'm fairly sure that's true.
That totally makes sense. Thanks for the reply. Can close this if you feel it shouldn't be added but would be nice if it was supported out of the box.
This project used to support in place modification of archives; however, I removed it because it complicated the implementation and took away control of a couple important aspects of exactly how the edit should be performed. For instance, the user may need the new archive to be created in a temporary location on another filesystem due to space constraints and then moved over to replace the original.
In the end, I decided to view this in the same way as directly changing the middle of any file. If you do that, you need to rewrite the file and then replace the original. There's no way to delete any part of the middle in any other way.
How do you delete or replace items from a zip?