[FileTools] Set the access for the file to be as deletable as possible

This commit is contained in:
Matt Nadareski
2016-09-22 10:07:49 -07:00
parent 0458e77293
commit bcab3b72d0

View File

@@ -9,6 +9,7 @@ using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Security.AccessControl;
using System.Security.Cryptography;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
@@ -1244,7 +1245,9 @@ namespace SabreTools.Helper
/// <param name="filename">Name of the file to be deleted</param>
public async static void DeleteFile(string filename)
{
File.SetAttributes(filename, 0);
FileInfo fi = new FileInfo(filename);
fi.IsReadOnly = false;
await Task.Factory.StartNew(() =>
{
while (fi.Exists)