ZipFile.Save method get blocked into WaitOne()

Sep 16, 2011 at 6:36 PM
Edited Sep 16, 2011 at 7:44 PM

Hi all,

I'm using the lastest version of the library with the next code:

 

using (ZipFile comprimido = new ZipFile())
                {
                    comprimido.Comment = "Compresion generada por el servicio " + fechaActual.ToString("yyyy-MM-dd HH:mm");
                    comprimido.AddDirectory(registro.Path);
                    comprimido.MaxOutputSegmentSize = 1024 * 1024 * 50;
                    if (!registro.SobreEscribir && System.IO.File.Exists(archivo))
                    {
                        System.IO.File.Delete(archivo);
                    }
                    comprimido.Save(archivo);
                 
                }

 

where "registro" is a datarow from typed data source, "archivo" is a filename of the zip file, and "fechaActual" is an instance from DateTime.Now, when i use this code with directories with a lot of sub folders and files (small, midle and big sized files), it runs until the process stop(or get into wait state). i tried to verify the problem in the souce code of Ionic.Zip dll, and  when the zip process get blocked (always get blocked in the same file), i press pause in my depurator and the current line that shows me is _newlyCompressedBlob.WaitOne(); at Line 930, at file ParallelDeflateOutputStream.cs, it doesn´t happen when I use step by step debbugging, in this case the process finish the zip file without errors.

When i tried solve the problem, i deleted the file where the processes stuck, but the process get blocked in another file,

 

Anybody has any idea of my problem

Coordinator
Sep 16, 2011 at 8:21 PM

It sounds to me that it is failing in the parallel compression. You can use ParallelDeflateThreshold = -1, to disable parallel deflation, to avoid th eproblem.  In the meantime it sounds like a bug in the compressor, which I will need to fix.

 

Coordinator
Sep 16, 2011 at 8:21 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.