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