[DATFromDir] Put retry on intial delete too

This commit is contained in:
Matt Nadareski
2016-09-21 23:17:30 -07:00
parent 284c3e088e
commit 57f6d361f7
2 changed files with 15 additions and 5 deletions

View File

@@ -320,11 +320,19 @@ namespace SabreTools
// Cue to delete the file if it's a copy
if (_copyFiles)
{
try
int i = 0;
while (File.Exists(newItem) && i < 50)
{
Directory.Delete(Path.GetDirectoryName(newItem), true);
try
{
Directory.Delete(Path.GetDirectoryName(newItem), true);
}
catch
{
i++;
}
}
catch
if (File.Exists(newItem))
{
_clean.Add(newItem);
}