mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[FileTools] Create and use safe file/directory delete
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
using SabreTools.Helper.Data;
|
||||
using SabreTools.Helper.Tools;
|
||||
|
||||
#if MONO
|
||||
using System.IO;
|
||||
@@ -58,15 +59,8 @@ namespace SabreTools.Helper.Skippers
|
||||
// If the output file has size 0, delete it
|
||||
if (new FileInfo(output).Length == 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
File.Delete(output);
|
||||
success = false;
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Don't log this file deletion error
|
||||
}
|
||||
FileTools.SafeTryDeleteFile(output);
|
||||
success = false;
|
||||
}
|
||||
|
||||
return success;
|
||||
|
||||
Reference in New Issue
Block a user