os: Add helper to find host temp directory

This commit is contained in:
Cody Northrop
2017-07-05 16:29:10 +01:00
committed by baldurk
parent 78d64449d6
commit ac38e7cb63
3 changed files with 15 additions and 0 deletions
+1
View File
@@ -233,6 +233,7 @@ void GetDefaultFiles(const char *logBaseName, string &capture_filename, string &
string &target);
string GetHomeFolderFilename();
string GetAppFolderFilename(const string &filename);
string GetTempFolderFilename();
string GetReplayAppFilename();
void CreateParentDirectory(const string &filename);
+5
View File
@@ -59,6 +59,11 @@ string GetHomeFolderFilename()
return homedir;
}
string GetTempFolderFilename()
{
return string(GetTempRootPath()) + "/";
}
void CreateParentDirectory(const string &filename)
{
string fn = dirname(filename);
+9
View File
@@ -328,6 +328,15 @@ string GetAppFolderFilename(const string &filename)
return ret;
}
string GetTempFolderFilename()
{
wchar_t temp_filename[MAX_PATH];
GetTempPathW(MAX_PATH, temp_filename);
return StringFormat::Wide2UTF8(wstring(temp_filename));
}
uint64_t GetModifiedTimestamp(const string &filename)
{
wstring wfn = StringFormat::UTF82Wide(filename);