From b5e7c417ff8d0ef8c9dea2eb7533fdcd87aeb2ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Mon, 31 Jul 2017 15:18:43 +0800 Subject: [PATCH] SysConf: Fix writing a new SYSCONF On Windows, File::GetTempFilenameForAtomicWrite returns a path somewhere in C:\Users\XXX\AppData\Local\Temp\{UUID here}\ in which all writes just fail. Just use the SYSCONF path + ".tmp" for the temporary file name. --- Source/Core/Common/SysConf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Common/SysConf.cpp b/Source/Core/Common/SysConf.cpp index 422bbb3f2e..2f86379462 100644 --- a/Source/Core/Common/SysConf.cpp +++ b/Source/Core/Common/SysConf.cpp @@ -197,7 +197,7 @@ bool SysConf::Save() const std::copy(footer.cbegin(), footer.cend(), buffer.end() - footer.size()); // Write the new data. - const std::string temp_file = File::GetTempFilenameForAtomicWrite(m_file_name); + const std::string temp_file = m_file_name + ".tmp"; File::CreateFullPath(temp_file); { File::IOFile file(temp_file, "wb");