views:

172

answers:

2

I'm getting an error when I use the SharpZipLib. I have code that looks like

FastZip compressor = new FastZip();
compressor.CreateZip(outputFileName, currentWorkingDirectory, true, "");

Which seems to be correct. However, I get a ZipException claiming that

size was 0, but I expected 54

I have no idea what that means. Anyone have any insight, or a link to an API document of some sort?

+1  A: 

Here are links to their source code and a help file with API documentation.

Justin Ethier
+1  A: 

It turns out the issue was as follows. I was trying to make a .zip file of all the items in a given directory, and place that .zip file IN the directory. Apparently the way this library works, the .zip file is created, and then the directory is read in file-by-file, writing into the .zip file. The error occured when it tried to add the .zip file itself to the zip! It was probably denied access to the file or something at that point, resulting in the error above. Simple fix was to create the .ZIP file in a different directory.

GWLlosa