mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-12 14:46:49 +01:00
Common/FileUtil: Revert behavior of CreateFullPath().
This was accidentally changed in 7e6436db347c3cc479d768180de158a0f9c88226.
This commit is contained in:
parent
661b74f4a3
commit
0758e00cfe
@ -209,13 +209,12 @@ bool CreateDir(const std::string& path)
|
|||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Creates the full path of fullPath returns true on success
|
bool CreateFullPath(std::string_view fullPath)
|
||||||
bool CreateFullPath(const std::string& fullPath)
|
|
||||||
{
|
{
|
||||||
DEBUG_LOG_FMT(COMMON, "{}: path {}", __func__, fullPath);
|
DEBUG_LOG_FMT(COMMON, "{}: path {}", __func__, fullPath);
|
||||||
|
|
||||||
std::error_code error;
|
std::error_code error;
|
||||||
auto native_path = StringToPath(fullPath);
|
auto native_path = StringToPath(fullPath).parent_path();
|
||||||
bool success = fs::create_directories(native_path, error);
|
bool success = fs::create_directories(native_path, error);
|
||||||
// If the path was not created, check if it was a pre-existing directory
|
// If the path was not created, check if it was a pre-existing directory
|
||||||
if (!success && fs::is_directory(native_path))
|
if (!success && fs::is_directory(native_path))
|
||||||
|
@ -143,8 +143,10 @@ u64 GetSize(FILE* f);
|
|||||||
// Returns true if successful, or path already exists.
|
// Returns true if successful, or path already exists.
|
||||||
bool CreateDir(const std::string& filename);
|
bool CreateDir(const std::string& filename);
|
||||||
|
|
||||||
// Creates the full path of fullPath returns true on success
|
// Creates the full path to the file given in fullPath.
|
||||||
bool CreateFullPath(const std::string& fullPath);
|
// That is, for path '/a/b/c.bin', creates folders '/a' and '/a/b'.
|
||||||
|
// Returns true if creation is successful or if the path already exists.
|
||||||
|
bool CreateFullPath(std::string_view fullPath);
|
||||||
|
|
||||||
enum class IfAbsentBehavior
|
enum class IfAbsentBehavior
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user