diff --git a/source/Reloaded.Mod.Loader.IO/Utility/IOEx.cs b/source/Reloaded.Mod.Loader.IO/Utility/IOEx.cs index 20b016c0..1b1bdf44 100644 --- a/source/Reloaded.Mod.Loader.IO/Utility/IOEx.cs +++ b/source/Reloaded.Mod.Loader.IO/Utility/IOEx.cs @@ -22,17 +22,7 @@ public static void MoveDirectory(string source, string target) // Get destination file path var destFileName = Path.GetFileName(sourceFilePath); var destFilePath = Path.Combine(target, destFileName); - - while (File.Exists(destFilePath) && !CheckFileAccess(destFilePath, FileMode.Open, FileAccess.Write)) - Thread.Sleep(100); - - while (File.Exists(sourceFilePath) && !CheckFileAccess(sourceFilePath, FileMode.Open, FileAccess.Write)) - Thread.Sleep(100); - - if (File.Exists(destFilePath)) - File.Delete(destFilePath); - - File.Move(sourceFilePath, destFilePath); + MoveFile(sourceFilePath, destFilePath); } // Get all subdirectories in source directory.