0
I have an update solution for an application that uses the Dotnetzip API (http://dotnetzip.codeplex.com/) for handling ZIP files. One of the methods used is to overwrite files in certain folders as follows:.
ZipFile zipFile = ZipFile.Read(file);
{
foreach (ZipEntry zipEntry in zipFile)
{
zipEntry.Extract(@"C:\IASD\CantinaEscolar", ExtractExistingFileAction.OverwriteSilently);
}
}
Where: @"c:\IASD\CantinaEscolar"
is the place where the files that are inside the zip will be unzipped (file)
.
But if the directory already has a file with the same name as the one that will be unzipped, the application is returning an error regarding the file already exists in the directory.
System.IO.IOException: The file 'c:\IASD\CantinaEscola\nomedoarquivo.exe' already exists
.
That method OverwriteSilently
should not overwrite uncompressed files silently (no user confirmation request)?
Or: Is there any way to force this superscript into the directory (type -f or something similar)?
If you have any other tips on how to accomplish this task, I will be grateful.