diff --git a/SabreTools.Library/DatFiles/DatFile.cs b/SabreTools.Library/DatFiles/DatFile.cs index ec5cc2fe..7f94723d 100644 --- a/SabreTools.Library/DatFiles/DatFile.cs +++ b/SabreTools.Library/DatFiles/DatFile.cs @@ -1975,16 +1975,13 @@ namespace SabreTools.Library.DatFiles /// True if blank items should be created for empty folders, false otherwise /// True if dates should be archived for all files, false otherwise /// Output directory to - /// True if files should be copied to the temp directory before hashing, false otherwise /// True if archive header should be used, false otherwise - /// TODO: Look into removing "copyFiles". I don't think it's useful anymore public bool PopulateFromDir( string basePath, TreatAsFile asFiles = 0x00, SkipFileType skipFileType = SkipFileType.None, bool addBlanks = false, bool addDate = false, - bool copyFiles = false, bool quickScan = false) { // Clean the temp directory path @@ -1999,7 +1996,7 @@ namespace SabreTools.Library.DatFiles List files = Directory.EnumerateFiles(basePath, "*", SearchOption.AllDirectories).ToList(); Parallel.ForEach(files, Globals.ParallelOptions, item => { - CheckFileForHashes(item, basePath, asFiles, skipFileType, addBlanks, addDate, copyFiles, quickScan); + CheckFileForHashes(item, basePath, asFiles, skipFileType, addBlanks, addDate, quickScan); }); // Now find all folders that are empty, if we are supposed to @@ -2047,7 +2044,6 @@ namespace SabreTools.Library.DatFiles skipFileType, addBlanks, addDate, - copyFiles, quickScan); } @@ -2069,7 +2065,6 @@ namespace SabreTools.Library.DatFiles /// Type of files that should be skipped /// True if blank items should be created for empty folders, false otherwise /// True if dates should be archived for all files, false otherwise - /// True if files should be copied to the temp directory before hashing, false otherwise /// True if archive header should be used, false otherwise private void CheckFileForHashes( string item, @@ -2078,18 +2073,14 @@ namespace SabreTools.Library.DatFiles SkipFileType skipFileType, bool addBlanks, bool addDate, - bool copyFiles, bool quickScan) { // If we're in depot mode, process it separately if (CheckDepotFile(item)) return; - // If we're copying files, copy it first and get the new filename - (string newItem, string newBasePath) = CopyIfNeeded(item, basePath, copyFiles); - // Initialize possible archive variables - BaseArchive archive = BaseArchive.Create(newItem, quickScan); + BaseArchive archive = BaseArchive.Create(item, quickScan); List extracted = null; // If we have an archive and we're supposed to scan it @@ -2105,15 +2096,11 @@ namespace SabreTools.Library.DatFiles // If the extracted list is null, just scan the item itself if (extracted == null) - ProcessFile(newItem, newBasePath, addDate, asFiles); + ProcessFile(item, basePath, addDate, asFiles); // Otherwise, add all of the found items else - ProcessArchive(newItem, newBasePath, addBlanks, archive, extracted); - - // Cue to delete the file if it's a copy - if (copyFiles && item != newItem) - DirectoryExtensions.TryDelete(newBasePath); + ProcessArchive(item, basePath, addBlanks, archive, extracted); } /// diff --git a/SabreTools.Library/README.1ST b/SabreTools.Library/README.1ST index 615fbb83..fec76727 100644 --- a/SabreTools.Library/README.1ST +++ b/SabreTools.Library/README.1ST @@ -390,12 +390,6 @@ Options: information in the output DAT. The output format is standardized as "yyyy/MM/dd HH:mm:ss". - -cf, --copy-files Copy files to the temp directory before parsing - If this flag is set, then all files that are going to be parsed are - moved to the temporary directory before being hashed. This can be - helpful in cases where the temp folder is located on an SSD and the - user wants to take advantage of this. - -h=, --header= Set a header skipper to use, blank means all Set the header special field for the output DAT(s). In file rebuilding, this flag allows for either all copier headers (using "") diff --git a/SabreTools.Library/README.DEPRECIATED b/SabreTools.Library/README.DEPRECIATED index eb2733af..b7d89ff1 100644 --- a/SabreTools.Library/README.DEPRECIATED +++ b/SabreTools.Library/README.DEPRECIATED @@ -156,6 +156,12 @@ Below are originally from SabreTools / DATabase - -clean Clean game names according to WoD standards -out= Output directory out= Output directory + + -cf, --copy-files Copy files to the temp directory before parsing + If this flag is set, then all files that are going to be parsed are + moved to the temporary directory before being hashed. This can be + helpful in cases where the temp folder is located on an SSD and the + user wants to take advantage of this. -cv, --convert Enable conversion of input files to unarchived folders Using a folder or set of folders, rebuild to another folder. diff --git a/SabreTools/Features/BaseFeature.cs b/SabreTools/Features/BaseFeature.cs index 22dfeeab..e460155b 100644 --- a/SabreTools/Features/BaseFeature.cs +++ b/SabreTools/Features/BaseFeature.cs @@ -206,20 +206,6 @@ namespace SabreTools.Features } } - internal const string CopyFilesValue = "copy-files"; - internal static Library.Help.Feature CopyFilesFlag - { - get - { - return new Library.Help.Feature( - CopyFilesValue, - new List() { "-cf", "--copy-files" }, - "Copy files to the temp directory before parsing", - Library.Help.FeatureType.Flag, - longDescription: "If this flag is set, then all files that are going to be parsed are moved to the temporary directory before being hashed. This can be helpful in cases where the temp folder is located on an SSD and the user wants to take advantage of this."); - } - } - internal const string DatDeviceNonMergedValue = "dat-device-non-merged"; internal static Library.Help.Feature DatDeviceNonMergedFlag { diff --git a/SabreTools/Features/DatFromDir.cs b/SabreTools/Features/DatFromDir.cs index 55f06e40..30de1c95 100644 --- a/SabreTools/Features/DatFromDir.cs +++ b/SabreTools/Features/DatFromDir.cs @@ -45,7 +45,6 @@ namespace SabreTools.Features AddHeaderFeatures(); AddFeature(AddBlankFilesFlag); AddFeature(AddDateFlag); - AddFeature(CopyFilesFlag); AddFeature(HeaderStringInput); AddFeature(ExtraIniListInput); AddFilteringFeatures(); @@ -62,7 +61,6 @@ namespace SabreTools.Features bool addBlankFiles = GetBoolean(features, AddBlankFilesValue); bool addFileDates = GetBoolean(features, AddDateValue); TreatAsFile asFiles = GetTreatAsFiles(features); - bool copyFiles = GetBoolean(features, CopyFilesValue); bool noAutomaticDate = GetBoolean(features, NoAutomaticDateValue); var omitFromScan = GetOmitFromScan(features); var skipFileType = GetSkipFileType(features); @@ -97,7 +95,6 @@ namespace SabreTools.Features skipFileType, addBlankFiles, addFileDates, - copyFiles, quickScan: omitFromScan == Hash.SecureHashes); if (success)