FAES/Utilities/FileAES_IntUtilities.cs
/// <summary>
/// Creates a new temp path and adds it to the instancedTempFolders list
/// </summary>
/// <param name="file">FAES File</param>
/// <param name="tempFolder">Temp Folder Root</param>
/// <param name="InstanceFolder">Folder for current instance of FAES</param>
/// <param name="mergeDateTime">Merge DateTime folder into the temp folder name</param>
/// <returns>Temp path created</returns>
Creates a new temp path and adds it to the instancedTempFolders list
Creates a new temp path and adds it to the instancedTempFolders list
internal static string CreateTempPath(FAES_File file, string tempFolder, string InstanceFolder, bool mergeDateTime = false)
        {
            string dateTime = GetUnixTime();
            string tempInstancePath = tempFolder;
            if (mergeDateTime)
                tempInstancePath = tempFolder + dateTime;
            else
                tempInstancePath = Path.Combine(tempFolder, dateTime);
            string tempPath = Path.Combine(tempInstancePath, InstanceFolder);
            if (FileAES_Utilities._instancedTempFolders.All(tPath => tPath.GetFaesFile().GetFileName() != file.GetFileName()))
            {
                AddToInstancedFolder(file, tempInstancePath);
                Logging.Log($"Created TempPath: {tempPath}", Severity.DEBUG);
            }
            else
            {
                tempPath = FileAES_Utilities._instancedTempFolders.First(tPath => tPath.GetFaesFile().GetFileName() == file.GetFileName()).GetTempPath();
            }
            if (!Directory.Exists(tempPath))
            {
                Directory.CreateDirectory(tempPath);
                File.SetAttributes(tempInstancePath, FileAttributes.Hidden);
            }
            return tempPath;
        }
internal static string CreateTempPath ( FAES_File file , string tempFolder , string InstanceFolder , bool mergeDateTime = false ) { string dateTime = GetUnixTime ( ) ; string tempInstancePath = tempFolder ; if ( mergeDateTime ) tempInstancePath = tempFolder + dateTime ; else tempInstancePath = Path . Combine ( tempFolder , dateTime ) ; string tempPath = Path . Combine ( tempInstancePath , InstanceFolder ) ; if ( FileAES_Utilities . _instancedTempFolders . All ( tPath => tPath . GetFaesFile ( ) . GetFileName ( ) != file . GetFileName ( ) ) ) { AddToInstancedFolder ( file , tempInstancePath ) ; Logging . Log ( $" Created TempPath:  { tempPath } " , Severity . DEBUG ) ; } else { tempPath = FileAES_Utilities . _instancedTempFolders . First ( tPath => tPath . GetFaesFile ( ) . GetFileName ( ) == file . GetFileName ( ) ) . GetTempPath ( ) ; } if ( ! Directory . Exists ( tempPath ) ) { Directory . CreateDirectory ( tempPath ) ; File . SetAttributes ( tempInstancePath , FileAttributes . Hidden ) ; } return tempPath ; }
Creates a new temp path and adds it to the instancedTempFolders list
Creates a new temp path and adds it to the instancedTempFolders list
Temp path created
Temp path created
file
FAES_File
None
tempFolder
string
Temp Folder Root
Temp Folder Root
InstanceFolder
string
Folder for current instance of FAES
Folder for current instance of FAES
mergeDateTime
bool
Merge DateTime folder into the temp folder name
Merge DateTime folder into the temp folder name