UNZIP FAILED ! DENIED ! HELP

Oct 22, 2011 at 4:44 PM

Hello,

I;m using ionic.zip ! and I get this error : Acess to path : C:\BlABLA\myfolder\File.exe.PendingOverwrite' is denied ! how can I solve this ( it shows to win 7 )!

 

 

Coordinator
Nov 7, 2011 at 4:27 PM

I DON'T KNOW!

HOW TO SOLVE IT!

MAYBE YOU COULD!

GIVE SOME MORE INFORMATION!

LIKE A FULL EXCEPTION STACKTRACE!

Feb 20, 2012 at 12:29 PM
Edited Feb 20, 2012 at 12:43 PM

I faced the same problem and fixed it by the following way:

 

foreach (ZipEntry entry in zipFile.Entries)
{
  try
  {
    entry.Extract(path, ExtractExistingFileAction.OverwriteSilently);
  }
  catch (IOException ex)
  {
    bool b = false;
    foreach (var postFix in new[] { ".tmp", ".PendingOverwrite" })
    {
      var errorPath = Path.Combine(path, entry.FileName) + postFix;
      if (File.Exists(errorPath))
      {
        File.Delete(errorPath);
        b = true;
      }
    }
    if(!b)
    {
      throw ex;
    }
   entry.Extract(path, ExtractExistingFileAction.OverwriteSilently);
} }