diff --git a/SabreTools.Helper/Data/Build.cs b/SabreTools.Helper/Data/Build.cs index 96b7dc09..274b77d9 100644 --- a/SabreTools.Helper/Data/Build.cs +++ b/SabreTools.Helper/Data/Build.cs @@ -217,6 +217,7 @@ namespace SabreTools.Helper.Data helptext.Add(" -dat= Input DAT to rebuild against"); helptext.Add(" -out= Output directory"); helptext.Add(" -t=, --temp= Set the temporary directory to use"); + helptext.Add(" -set Enable set-creation mode (lower I/O, slower)"); helptext.Add(" -del, --delete Delete input files [DO NOT USE]"); helptext.Add(" -in, --inverse Rebuild only files not in DAT"); helptext.Add(" -qs, --quick Enable quick scanning of archives"); diff --git a/SabreTools.Helper/Dats/Partials/DatFile.Rebuild.cs b/SabreTools.Helper/Dats/Partials/DatFile.Rebuild.cs index 42047734..2920ce20 100644 --- a/SabreTools.Helper/Dats/Partials/DatFile.Rebuild.cs +++ b/SabreTools.Helper/Dats/Partials/DatFile.Rebuild.cs @@ -158,6 +158,7 @@ namespace SabreTools.Helper.Dats // If the input is a file if (File.Exists(input)) { + logger.User("Checking file: '" + input + "'"); RebuildToOutputWithoutSetsHelper(input, outDir, tempDir, quickScan, date, delete, inverse, outputFormat, romba, archiveScanLevel, updateDat, headerToCheckAgainst, maxDegreeOfParallelism, logger); } @@ -165,9 +166,10 @@ namespace SabreTools.Helper.Dats // If the input is a directory else if (Directory.Exists(input)) { - List files = Directory.EnumerateFiles(input, "*", SearchOption.AllDirectories).ToList(); - foreach (string file in files) + logger.User("Checking directory: '" + input + "'"); + foreach (string file in Directory.EnumerateFiles(input, "*", SearchOption.AllDirectories)) { + logger.User("Checking file: '" + file + "'"); RebuildToOutputWithoutSetsHelper(file, outDir, tempDir, quickScan, date, delete, inverse, outputFormat, romba, archiveScanLevel, updateDat, headerToCheckAgainst, maxDegreeOfParallelism, logger); } diff --git a/SabreTools.Helper/README.1ST b/SabreTools.Helper/README.1ST index 294f2759..a15b42c1 100644 --- a/SabreTools.Helper/README.1ST +++ b/SabreTools.Helper/README.1ST @@ -377,7 +377,7 @@ Options: The user-supplied DAT used to check which files need to be rebuilt. Multiple occurrences of this flag are allowed. - -out= Set the name of the output directory + -out= Set the name of the output directory This sets an output folder to be used when the files are created. If a path is not defined, the application directory is used instead. @@ -386,6 +386,13 @@ Options: (inside the running folder) is not preferred. This is used for any operations that require an archive to be extracted. + -set Enable set-creation mode (lower I/O, slower) + Optionally for slower computers, set-creation mode can be enabled. This mode parses + through all inputs and creates the logical sets first, reducing the amount of I/O + that is required to rebuild all sets by opening each output folder or archive only + once. This is much slower than the standard mode, however, because of the preprocessing + that it requires. + -d, --delete Enable deletion of the input files [DO NOT USE] Optionally, the input files, once processed, can be deleted. This can be useful when the original file structure is no longer needed or if there is limited space diff --git a/SabreTools/Partials/SabreTools.Inits.cs b/SabreTools/Partials/SabreTools.Inits.cs index 8c4c7495..92ab3b31 100644 --- a/SabreTools/Partials/SabreTools.Inits.cs +++ b/SabreTools/Partials/SabreTools.Inits.cs @@ -301,6 +301,7 @@ namespace SabreTools /// List of input files/folders to check /// Output directory to use to build to /// Temporary directory for archive extraction + /// True if set-building mode should be enabled, false otherwise /// True to enable external scanning of archives, false otherwise /// True if the date from the DAT should be used if available, false otherwise /// True if input files should be deleted, false otherwise @@ -314,7 +315,7 @@ namespace SabreTools /// True if the updated DAT should be output, false otherwise /// Populated string representing the name of the skipper to use, a blank string to use the first available checker, null otherwise /// Integer representing the maximum amount of parallelization to be used - private static void InitSort(List datfiles, List inputs, string outDir, string tempDir, bool quickScan, bool date, bool delete, + private static void InitSort(List datfiles, List inputs, string outDir, string tempDir, bool set, bool quickScan, bool date, bool delete, bool inverse, OutputFormat outputFormat, bool romba, int sevenzip, int gz, int rar, int zip, bool updateDat, string headerToCheckAgainst, int maxDegreeOfParallelism) { @@ -332,7 +333,7 @@ namespace SabreTools } _logger.User("Populating complete in " + DateTime.Now.Subtract(start).ToString(@"hh\:mm\:ss\.fffff")); - datdata.RebuildToOutput(inputs, outDir, tempDir, true /*set*/, quickScan, date, delete, inverse, outputFormat, romba, asl, + datdata.RebuildToOutput(inputs, outDir, tempDir, set, quickScan, date, delete, inverse, outputFormat, romba, asl, updateDat, headerToCheckAgainst, maxDegreeOfParallelism, _logger); } diff --git a/SabreTools/SabreTools.cs b/SabreTools/SabreTools.cs index b3030993..b9e7cdf3 100644 --- a/SabreTools/SabreTools.cs +++ b/SabreTools/SabreTools.cs @@ -88,6 +88,7 @@ namespace SabreTools remext = false, removeDateFromAutomaticName = false, romba = false, + set = false, showBaddumpColumn = false, showNodumpColumn = false, shortname = false, @@ -430,6 +431,10 @@ namespace SabreTools case "--superdat": superdat = true; break; + case "-set": + case "--set": + set = true; + break; case "-sf": case "--skip": skip = true; @@ -1052,7 +1057,7 @@ namespace SabreTools // If we're using the sorter else if (sort) { - InitSort(datfiles, inputs, outDir, tempDir, quickScan, addFileDates, delete, inverse, + InitSort(datfiles, inputs, outDir, tempDir, set, quickScan, addFileDates, delete, inverse, outputFormat, romba, sevenzip, gz, rar, zip, updateDat, header, maxParallelism); }