1

Closed

Possible error using AddDirectory function

description

Hi,
 
I have been test driving the ZipDir example and found a strange behaviour.
I changed the the AddDirectory call to this:
 
using (ZipFile zip = new ZipFile(args[0], System.Console.Out))
        {
            zip.AddDirectory(args[1], System.IO.Path.GetFileName(args[1]).ToString()+"\\");                    
            zip.Save();
        }
 
So that the path in the zip would start at the foldername (Home) excluding c:\Users\BRJ\Documents\Programs\Zip\DOT.NET\DotNetZip-src-v1.2\DotNetZip\Examples\ZipDir\bin\Debug\
 
 
This is the commandline call to ZipDir.exe:
 
ZipDir.exe home.zip c:\Users\BRJ\Documents\Programs\Zip\DOT.NET\DotNetZip-src-v1.2\DotNetZip\Examples\ZipDir\bin\Debug\home
 
In the home directory there are following files:
vee.io
\test\vee.io
 
This proceduces exception: System.Exception: That entry already exists.
at Ionic.Utils.Zip.ZipFile.InsureUniqueEntry(ZipEntry ze1) in c:\dinoch\dev\d
otnet\zip\DotNetZip\Library\ZipFile.cs:line 442
at Ionic.Utils.Zip.ZipFile.AddFile(String FileName, String DirectoryPathInArc
hive) in c:\dinoch\dev\dotnet\zip\DotNetZip\Library\ZipFile.cs:line 430
at Ionic.Utils.Zip.ZipFile.AddDirectory(String DirectoryName, String Director
yPathInArchive) in c:\dinoch\dev\dotnet\zip\DotNetZip\Library\ZipFile.cs:line 49
3
at Ionic.Utils.Zip.ZipFile.AddDirectory(String DirectoryName, String Director
yPathInArchive) in c:\dinoch\dev\dotnet\zip\DotNetZip\Library\ZipFile.cs:line 49
9
at ZipDir.Main(String[] args) in C:\Users\BRJ\Documents\Programs\Zip\DOT.NET\
DotNetZip-src-v1.2\DotNetZip\Examples\ZipDir\ZipDir.cs:line 63
 
However using the function:
zip.AddDirectory(args[1]);
 
Proceduces a zip containing the same files two times with no problems ??
 
Am I using it wrong, or is this a library error ?
 
Best regards
 
Brian
Closed Feb 5, 2008 at 8:57 PM by Cheeso
fixed in v1.3

comments

Cheeso wrote Feb 1, 2008 at 4:06 PM

fixed in changset 14438.

Cheeso wrote Feb 5, 2008 at 8:57 PM

** Closed by Cheeso 2/1/2008 9:09 AM

Cheeso wrote Feb 5, 2008 at 8:57 PM

re-opening to assign to a release.