mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[DatFile] RandomFileName is not good enough
This commit is contained in:
@@ -3344,7 +3344,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
SkipFileType skipFileType, bool addBlanks, bool addDate, string tempDir, bool copyFiles, string headerToCheckAgainst, bool chdsAsFiles)
|
SkipFileType skipFileType, bool addBlanks, bool addDate, string tempDir, bool copyFiles, string headerToCheckAgainst, bool chdsAsFiles)
|
||||||
{
|
{
|
||||||
// Define the temporary directory
|
// 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)
|
// Special case for if we are in Romba mode (all names are supposed to be SHA-1 hashes)
|
||||||
if (Romba)
|
if (Romba)
|
||||||
@@ -3373,7 +3373,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
string newBasePath = basePath;
|
string newBasePath = basePath;
|
||||||
if (copyFiles)
|
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)));
|
newItem = Path.GetFullPath(Path.Combine(newBasePath, Path.GetFullPath(item).Remove(0, basePath.Length + 1)));
|
||||||
Directory.CreateDirectory(Path.GetDirectoryName(newItem));
|
Directory.CreateDirectory(Path.GetDirectoryName(newItem));
|
||||||
File.Copy(item, newItem, true);
|
File.Copy(item, newItem, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user