Reputation: 35
I have a zip archive with a lot of files(other zip files, text files, gz archives) inside it. Need to create a new zip file with the same structure. Some info in the new zip must be changed. For example, need to change all 'a' letters in all files to the letter 'b'. Need to resolve the task without creating temp files or unpacking archives to the temp folders. How can I do it?
Upvotes: 0
Views: 70
Reputation: 112492
If you need to do this entirely streaming, you will need to parse the zip file format, copy entries that are not being modified to a new zip file, and process entries that are being modified by decompressing them and recompressing them in streams, copying to the new zip file.
If you don't need to do this streaming, then extract the entries you want to modify, removing them from the zip file. Modify them. Then add them to the zip file using any zip utility.
Upvotes: 1