Extracting a nested zip

May 14, 2009 at 10:12 AM

I've started using this excellent little library recently, and have found it handles all but one requirement...

I've a zip file containing other embedded zip files, is it possible to extract files from an 'inner' zip file without extracting it first from the main zip?  (i.e. as you could through Windows explorer for instance?)

Coordinator
May 14, 2009 at 10:22 AM

No  - in code you would have to extract the embedded zip in order to extract anything from it. The user interface you see with Windows Explorer is obscuring the fact that Explorer is opening and examining the embedded zip file, and thus extracting it.

It is possible, though, with DotNetZip to extract the embedded zip into an in-memory structure, and then to extract files from THAT.  In other words, you need not extract the embedded zip to a disk file, in order to extract extries from it.   But you DO need to extract it.  See the ZipEntry.OpenReader() method, for assistance on that.

 

 

Coordinator
May 14, 2009 at 10:23 AM

ps:  reminder: DotNetZip is donationware.  If you like DotNetZip and find it valuable, I encourage you to donate.

http://cheeso.members.winisp.net/DotNetZipDonate.aspx