This commit is contained in:
2021-12-08 19:18:21 +00:00
parent 6af640380b
commit b7b7e09b81

View File

@@ -349,7 +349,7 @@ namespace AyaNova.Util
{
//Console.WriteLine("b fileutil:backupfilesdriveavailablespace, backupfilesfolder:", ServerBootConfig.AYANOVA_BACKUP_FILES_PATH);
//Console.WriteLine("fileutil:backupfilesdriveavailablespace, backupfilesfolder FULLPATH:", Path.GetFullPath(ServerBootConfig.AYANOVA_BACKUP_FILES_PATH));
// Console.WriteLine("fileutil:backupfilesdriveavailablespace, backupfilesfolder PATHROOT:", Path.GetPathRoot(ServerBootConfig.AYANOVA_BACKUP_FILES_PATH));
// Console.WriteLine("fileutil:backupfilesdriveavailablespace, backupfilesfolder PATHROOT:", Path.GetPathRoot(ServerBootConfig.AYANOVA_BACKUP_FILES_PATH));
return new System.IO.DriveInfo(Path.GetPathRoot(ServerBootConfig.AYANOVA_BACKUP_FILES_PATH)).AvailableFreeSpace;
}
@@ -811,15 +811,14 @@ namespace AyaNova.Util
{
return string.Empty;
}
//only applies if there is a % in it
//"A string containing the names of zero or more environment variables. Each environment variable is quoted with the percent sign character (%)."
if(!path.Contains('%')){
return path;
//Linux ~ home folder special handling here
if (path.Contains('~'))
{
//return because no environment variables are expended on linux, this is the only special character
return path.Replace("~", Environment.GetFolderPath(Environment.SpecialFolder.UserProfile));
}
return System.Environment.ExpandEnvironmentVariables(path);
}