From 161a869e0fb36e89a072c790f9740208ecfaec40 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Tue, 5 Dec 2017 15:10:04 -0800 Subject: [PATCH] [DatFile] RandomFileName is not good enough --- SabreTools.Library/DatFiles/DatFile.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SabreTools.Library/DatFiles/DatFile.cs b/SabreTools.Library/DatFiles/DatFile.cs index 0e1395e0..44826bbc 100644 --- a/SabreTools.Library/DatFiles/DatFile.cs +++ b/SabreTools.Library/DatFiles/DatFile.cs @@ -3344,7 +3344,7 @@ namespace SabreTools.Library.DatFiles SkipFileType skipFileType, bool addBlanks, bool addDate, string tempDir, bool copyFiles, string headerToCheckAgainst, bool chdsAsFiles) { // Define the temporary directory - string tempSubDir = Path.GetFullPath(Path.Combine(tempDir, Path.GetRandomFileName())) + Path.DirectorySeparatorChar; + string tempSubDir = Path.GetFullPath(Path.Combine(tempDir, new Guid().ToString())) + Path.DirectorySeparatorChar; // Special case for if we are in Romba mode (all names are supposed to be SHA-1 hashes) if (Romba) @@ -3373,7 +3373,7 @@ namespace SabreTools.Library.DatFiles string newBasePath = basePath; if (copyFiles) { - newBasePath = Path.Combine(tempDir, Path.GetRandomFileName()); + newBasePath = Path.Combine(tempDir, new Guid().ToString()); newItem = Path.GetFullPath(Path.Combine(newBasePath, Path.GetFullPath(item).Remove(0, basePath.Length + 1))); Directory.CreateDirectory(Path.GetDirectoryName(newItem)); File.Copy(item, newItem, true);