Simplify FileUtil::Exists. Minor cleanups.
Might possibly help #7967 (XP) by avoiding _wstat64? That would be a libc bug though.
This commit is contained in:
parent
7e70a743ca
commit
0084b2ac30
2 changed files with 26 additions and 55 deletions
|
@ -593,16 +593,16 @@ void InitSysDirectories() {
|
|||
g_Config.memStickDirectory = myDocsPath;
|
||||
}
|
||||
|
||||
const std::string testFile = "/_writable_test.$$$";
|
||||
const std::string testFile = g_Config.memStickDirectory + "/_writable_test.$$$";
|
||||
|
||||
// If any directory is read-only, fall back to the Documents directory.
|
||||
// We're screwed anyway if we can't write to Documents, or can't detect it.
|
||||
if (!File::CreateEmptyFile(g_Config.memStickDirectory + testFile))
|
||||
if (!File::CreateEmptyFile(testFile))
|
||||
g_Config.memStickDirectory = myDocsPath;
|
||||
|
||||
// Clean up our mess.
|
||||
if (File::Exists(g_Config.memStickDirectory + testFile))
|
||||
File::Delete(g_Config.memStickDirectory + testFile);
|
||||
if (File::Exists(testFile))
|
||||
File::Delete(testFile);
|
||||
|
||||
if (g_Config.currentDirectory.empty()) {
|
||||
g_Config.currentDirectory = GetSysDirectory(DIRECTORY_GAME);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue