[DATFromDir, SimpleSort] Better temp folders

This commit is contained in:
Matt Nadareski
2016-09-16 16:21:11 -07:00
parent 4959c67bbb
commit c6c1c3de74
2 changed files with 4 additions and 4 deletions

View File

@@ -66,7 +66,7 @@ namespace SabreTools
_enableGzip = enableGzip;
_addBlanks = addBlanks;
_addDate = addDate;
_tempDir = (String.IsNullOrEmpty(tempDir) ? Path.Combine(Environment.CurrentDirectory, "__tempdir__") : tempDir);
_tempDir = (String.IsNullOrEmpty(tempDir) ? Path.Combine(Path.GetTempPath(), "__temp__") : tempDir);
_maxDegreeOfParallelism = maxDegreeOfParallelism;
_logger = logger;
}
@@ -199,7 +199,7 @@ namespace SabreTools
private void ProcessPossibleArchive(string item)
{
// Define the temporary directory
string tempSubDir = Path.GetFullPath(Path.Combine(_tempDir, Path.GetFileNameWithoutExtension(item))) + Path.DirectorySeparatorChar;
string tempSubDir = Path.GetFullPath(Path.Combine(_tempDir, Path.GetRandomFileName())) + Path.DirectorySeparatorChar;
// Special case for if we are in Romba mode (all names are supposed to be SHA-1 hashes)
if (_datdata.Romba)

View File

@@ -55,7 +55,7 @@ namespace SabreTools.Helper
_datdata = datdata;
_inputs = inputs;
_outdir = (outdir == "" ? "Rebuild" : outdir);
_tempdir = (tempdir == "" ? "__temp__" : tempdir);
_tempdir = (tempdir == "" ? Path.Combine(Path.GetTempPath(), "__temp__") : tempdir);
_quickScan = quickScan;
_toFolder = toFolder;
_verify = verify;
@@ -135,7 +135,7 @@ namespace SabreTools.Helper
foreach (string input in _inputs)
{
DATFromDir dfd = new DATFromDir(input, _datdata, false /* noMD5 */, false /* noSHA1 */, true /* bare */, false /* archivesAsFiles */,
true /* enableGzip */, false /* addBlanks */, false /* addDate */, "__temp__" /* tempdir */, 4 /* maxDegreeOfParallelism */, _logger);
true /* enableGzip */, false /* addBlanks */, false /* addDate */, "" /* tempdir */, 4 /* maxDegreeOfParallelism */, _logger);
dfd.Start();
_datdata = dfd.DatData;
}