Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

request example for working with zip files

Moderators: larsivi kris

Posted: 04/11/08 00:35:36

I have a zip file of multiple zipfiles each containing files, folders, and other zip files. I need to tunnel into the individual files buried in all subarchives and folders in order to edit/insert/remove information. Ultimately I'd like to do the work directly inside the zip file without having to decompressing and recompressing the files. Request a demonstration of how to accomplish this. I have looked at the example for working with vfs ZipFolders? but it doesn't provide enough coverage. I've looked at the online manual but there is currently no documentation for this feature.

Additionally, if this is not the correct way to go about accomplishing this desired task please provide as suggestion of how to do this properly.

Any assistance is greatly appreciated.


Author Message

Posted: 04/11/08 05:53:33

It is not possible in any practical way to do work on files inside a zip, to that the format is too intertwined. It should however be work like that is what you are doing, but you would need to be aware that it may be costly - ie implicit decompression and compression for every change.

The best is probably to mount the zip in a VFS instance, where it may use a temporary dir internally, do your operations there, and then close your zipfolder which will by default write changes to disk/zip. Sorry that I don't have an example handy, but knowing how things work may help understand how to approach the problem?