Issue with MaxOutputSegmentSize

May 27, 2010 at 12:41 AM

Hi,

So I am having inconsistent success when saving a spanned archive. Here is my code:

[Reflection.Assembly]::LoadFrom("C:\Ionic.Zip.dll")
		
$zipfile = new-object Ionic.Zip.ZipFile

$zipfile.AddDirectory("E:\Temp\Ghost 2.5")

$zipfile.MaxOutputSegmentSize = 256MB
$zipfile.UseZip64WhenSaving = [Ionic.Zip.Zip64Option]::AsNecessary
	
$zipfile.Save("C:\Documents and Settings\arisman1\Desktop\test\archive.zip")
$zipfile.Dispose()
The exception message is:
Exception calling "Save" with "1" argument(s): "Could not find file 'C:\Documents and Settings\arisman1\Desktop\test\archive.z01'."
 
As I watch the output being created in the output directory it goes like this:
 
1. First temp is created (DotNetZip-xfpfzyvv.tmp) 
2. Renamed to archive.z01 (268435456 bytes)
3. Second temp file is created (DotNetZip-cqpyp3kj.tmp) 
4. Renamed to archive.z02 (268435456 bytes)
5. Third temp file is created (DotNetZip-fdlhhjbu.tmp)
6. Third file grew to 62992952 bytes then was deleted
7. Fourth temp file appears (DotNetZip-m1uevlkg.tmp), the initial file size is 268435456 and did not grow. 
8. The exception occurs
9. The output folder is left with the forth temp file DotNetZip-m1uevlkg.tmp
This exception occurs on specific input folders. The input folder the exception is consitently occuring on has: 1,239,685,110 bytes, 270 Files, 50 folders. The same code works on other input folders.
This issue looks similar to: http://dotnetzip.codeplex.com/Thread/View.aspx?ThreadId=82929
 
May 27, 2010 at 4:27 AM

To recreate the error I downloaded a file generator: http://www.softpedia.com/get/Others/Miscellaneous/SVL-Random-File-Generator.shtml and generated a 512 MB file and put it in a folder all by itself. After that I added the directory to DotNetZip and attempted to save and received the same issue. It always appears to error with the z01 filename.