This project is read-only.

Can't Zip entire contents of drive

Aug 28, 2010 at 6:42 PM

Hi Cheeso,

In my backup program I'm trying to zip the entire contents of my D:\ Drive using the ZipFile.UpdateSelectedFiles method but for some reason its only zipping the contents of the working directory. If I use a folder inside the drive the code works perfectly, the problem ONLY happens when I use the root. Here is the code I'm using:


ZipFile zip = new ZipFile(fileName);
zip.UpdateSelectedFiles(exclusions, "D:\\", "D:\\" true);

Any help would be appreciated.
Aug 29, 2010 at 5:49 AM

if this is the exact code i think you're missing a comma zip.UpdateSelectedFiles(exclusions, "D:\\", "D:\\", true);

Aug 29, 2010 at 5:58 AM

Yes I'm sorry that's a typo. My actual code has the comma

Sep 16, 2010 at 10:27 PM

Does anyone have a suggestion on this?

Sep 18, 2010 at 5:01 PM

You could just do a scan of the root directory (top-level only) and do a foreach on each directory you find.  Then you can get around the problem, at the very least.

Sep 20, 2010 at 3:41 AM

Yes, that's the way I'm doing it right now the only problem with that is when I want to exclude a sub directory. Alternatively I can recurse through the sub directories but i was just trying to avoid writing that.

Sep 22, 2010 at 12:51 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.