This project is read-only.

Empty Folders are not added to a zip file

Jun 15, 2010 at 5:59 PM
I am using v1.9 of DotNetZip and really like its simplicty; however, I am having difficulty added empty folders to my zip file. My code is quite simple: using (ZipFile zip = new ZipFile()) { zip.UseUnicodeAsNecessary = true; zip.CompressionLevel = Ionic.Zlib.CompressionLevel.Default; zip.ZipErrorAction = ZipErrorAction.Skip; zip.AddDirectory(root); zip.Save(outputPath); } I'd like all files and folders (including empty folders) to be added to my zip file, but empty folders are not included. Is there a way to include empty folders? Steve
Jun 16, 2010 at 8:33 PM
I did some more digging. v1.9 does indeed capture empty folders. This is seen if you do one of two things: a) Use Windows Explorer to view the contents of the zip file, or b) uncompress the contents to a folder. It appears that WinZip simply doesn't display empty folders within its view box.
Jun 16, 2010 at 9:43 PM

ah, ok thanks for the followup.