This project is read-only.

DotNetZip doesn't zip file with file size 0 byte

Sep 26, 2010 at 10:00 AM

If the file size  = 0 byte and we are providing password in it. Then for those 0 byte file , DotNetZip doesn't work. What should I do ? However if the file size is not equal to 0 byte then password protection works.

Sep 29, 2010 at 5:22 AM
What do you mean, exactly, by "DotNetZip doesn't work"? What so you expect to happen? and what does actually happen? You should be aware that it is impossible to encrypt a zero-byte message. Applying a password to a zero byte message gets you a zero byte message. Therefore, in the case of a zero-byte file, dotnetzip does not perform any encryption.
Sep 29, 2010 at 8:48 AM

I mean suppose we create an empty file (.txt) and save it. Then using Winzip , if we compress it with password then even the empty file will be password protected.

The same thing we can't obtain through DotNetZip if the file size = 0 byte. In other cases it works fine ( not 0 byte). 

Sep 30, 2010 at 2:21 PM
What I understand then, is that DotNetZip behaves differently than Winzip. I dont see that as an error or a bug. I do not see it as a problem. I'm willing to listen to your reasoning that the current behavior is a bona fide bug, but at the moment, I am skeptical.
Oct 7, 2010 at 5:00 AM

Hi Cheeso,

DotNetZip might behaves differently than winzip but as i try with SharpZipLib It will prompt for password even for 0 byte file. So I am confused.  Can't we have latest DotNetZip Library that even solves this issue. Please ! suggest.

Oct 14, 2010 at 9:42 PM

I'm not sure what "solution" you are looking for.  I think what you are asking is for DotNetZip to behave differently.  At this point I am not convinced that it is appropriate, necessary, or even correct.

As I said, I am willing to listen to a justification for the proposed change, but "SharpZipLib does it this way" is not a justification.

Stepping back, what problem does this cause for you?  Maybe if I understood your situation better it would make more sense to me.


Oct 14, 2010 at 9:45 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.