SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

ICSharpCode.SharpZipLib.Zip.ZipException: size was 0, but I expected 14194

Last post 03-01-2008 4:04 PM by gatorbait. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-16-2007 7:04 AM

    • Sarmak
    • Not Ranked
    • Joined on 08-02-2007
    • Posts 2

    ICSharpCode.SharpZipLib.Zip.ZipException: size was 0, but I expected 14194

    When I am zipping folder which is having some files I am getting the following error.But the same folder able to zip in the second try..

     

      ICSharpCode.SharpZipLib.Zip.ZipException: size was 0, but I expected 14194   at ICSharpCode.SharpZipLib.Zip.ZipOutputStream.CloseEntry()   at ICSharpCode.SharpZipLib.Zip.ZipOutputStream.Finish()   at ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Close()   at System.IO.Stream.Dispose()   at ICSharpCode.SharpZipLib.Zip.FastZip.CreateZip(Stream outputStream, String sourceDirectory, Boolean recurse, String fileFilter, String directoryFilter)

       at ICSharpCode.SharpZipLib.Zip.FastZip.CreateZip(String zipFileName, String sourceDirectory, Boolean recurse, String fileFilter)

     

    Please suggest me the reason for this. The piece of code that I am using as follows

      public static void ZipFolder(string sourceFolder, string zipUrl){ FastZip fZip = null;  try  {   if ( !Directory.Exists( Path.GetDirectoryName( zipUrl )))    {     Directory.CreateDirectory( Path.GetDirectoryName( zipUrl ) );    }     fZip = new FastZip();     fZip.CreateEmptyDirectories = true;     fZip.CreateZip(zipUrl, sourceFolder, true, null);    }    catch (Exception ex)    {     Debug.WriteLine("Exception in ZipFolder():" + ex.ToString());     throw;    }

    }

    Filed under: ,
  • 11-19-2007 8:47 PM In reply to

    Re: ICSharpCode.SharpZipLib.Zip.ZipException: size was 0, but I expected 14194

    Hi,

    I am not sure whats going on.  It appears an entry has been made for a file whose size is 14194 bytes in size but no data has been written for that file.  There is no locking of files so although the size is gathered right before the data is read there is a known loophole there (which is being closed).  Otherwise I cant say.

    I would add some logging or use the debugger to try and get to the bottom of things I guess.

     

    hth, -jr- 

  • 03-01-2008 4:04 PM In reply to

    Re: ICSharpCode.SharpZipLib.Zip.ZipException: size was 0, but I expected 14194

    Did you ever figure this out?  I get this same error.  Sometimes the zip works, other times it doesn't.  I thought maybe I left a file handle open somewhere when I created my files to zip but I'm not.

Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.