Common/FileSystem: Add EnsureDirectoryExists()

This commit is contained in:
Connor McLaughlin authored and refractionpcsx2 committed 2022-02-24 10:18:49 +00:00
1 parent d6f1291c0b
commit ed9f34de5f
2 files changed
+13

No files matched your search

+9
View File
@@ -565,6 +565,15 @@ bool FileSystem::WriteFileToString(const char* filename, const std::string_view&
return true;
}
bool FileSystem::EnsureDirectoryExists(const char* path, bool recursive)
{
if (FileSystem::DirectoryExists(path))
return true;
// if it fails to create, we're not going to be able to use it anyway
return FileSystem::CreateDirectoryPath(path, recursive);
}
#ifdef _WIN32
static u32 TranslateWin32Attributes(u32 Win32Attributes)