diff --git a/SabreTools.Helper/Objects/DATFromDir.cs b/SabreTools.Helper/Objects/DATFromDir.cs index b06bbd17..61571869 100644 --- a/SabreTools.Helper/Objects/DATFromDir.cs +++ b/SabreTools.Helper/Objects/DATFromDir.cs @@ -66,7 +66,7 @@ namespace SabreTools _enableGzip = enableGzip; _addBlanks = addBlanks; _addDate = addDate; - _tempDir = tempDir; + _tempDir = (String.IsNullOrEmpty(tempDir) ? Path.Combine(Environment.CurrentDirectory, "__tempdir__") : tempDir); _maxDegreeOfParallelism = maxDegreeOfParallelism; _logger = logger; } @@ -199,8 +199,7 @@ namespace SabreTools private void ProcessPossibleArchive(string item) { // Define the temporary directory - string tempSubDir = (String.IsNullOrEmpty(_tempDir) ? Environment.CurrentDirectory : _tempDir); - tempSubDir = Path.GetFullPath(Path.Combine(tempSubDir, "__temp__", Path.GetFileNameWithoutExtension(item))) + Path.DirectorySeparatorChar; + string tempSubDir = Path.GetFullPath(Path.Combine(_tempDir, Path.GetFileNameWithoutExtension(item))) + Path.DirectorySeparatorChar; // Special case for if we are in Romba mode (all names are supposed to be SHA-1 hashes) if (_datdata.Romba) @@ -283,18 +282,18 @@ namespace SabreTools : ""), Path.GetFileNameWithoutExtension(item))); }); - - // Clear the temp directory - if (Directory.Exists(tempSubDir)) - { - FileTools.CleanDirectory(tempSubDir); - } } // Otherwise, just get the info on the file itself else if (File.Exists(item)) { ProcessFile(item, _basePath, ""); } + + // Delete the sub temp directory + if (Directory.Exists(tempSubDir)) + { + Directory.Delete(tempSubDir, true); + } } } diff --git a/SabreTools.Helper/Objects/SimpleSort.cs b/SabreTools.Helper/Objects/SimpleSort.cs index ef3a6431..367942ff 100644 --- a/SabreTools.Helper/Objects/SimpleSort.cs +++ b/SabreTools.Helper/Objects/SimpleSort.cs @@ -55,7 +55,7 @@ namespace SabreTools.Helper _datdata = datdata; _inputs = inputs; _outdir = (outdir == "" ? "Rebuild" : outdir); - _tempdir = (tempdir == "" ? "__TEMP__" : tempdir); + _tempdir = (tempdir == "" ? "__temp__" : tempdir); _quickScan = quickScan; _toFolder = toFolder; _verify = verify;