[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

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

View File

@@ -441,11 +441,13 @@ namespace SabreTools.Helper
/// </summary>
public static int CompareNumeric(string s, string other)
{
if ((s == null || s.Replace(" ", string.Empty).Length == 0) && (other != null && other.Replace(" ", string.Empty).Length > 0))
if ((s == null || s.Replace(" ", string.Empty).Length == 0)
&& (other != null && other.Replace(" ", string.Empty).Length > 0))
{
return -1;
}
if ((s != null && s.Replace(" ", string.Empty).Length > 0) && (other == null || other.Replace(" ", string.Empty).Length == 0))
if ((s != null && s.Replace(" ", string.Empty).Length > 0)
&& (other == null || other.Replace(" ", string.Empty).Length == 0))
{
return 1;
}