From 479df9809a72bd9cba94bbdb05466a44305497e5 Mon Sep 17 00:00:00 2001 From: crueter Date: Sat, 25 Jul 2026 01:48:49 +0200 Subject: [PATCH] [filesystem] Return ResultPathAlreadyExists from CreateDirectory if path exists (#4224) Returning success when the path already exists confuses games like Eastward which use this result in their save logic. Closes https://github.com/eden-emulator/mirror/pull/10 Signed-off-by: crueter Co-authored-by: Tom Pratt Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4224 Reviewed-by: Maufeat Reviewed-by: MaranBr --- src/core/hle/service/filesystem/filesystem.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index f873ebe53e..d5984f560b 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp @@ -108,7 +108,9 @@ Result VfsDirectoryServiceWrapper::DeleteFile(const std::string& path_) const { Result VfsDirectoryServiceWrapper::CreateDirectory(const std::string& path_) const { std::string path(Common::FS::SanitizePath(path_)); - + if (GetDirectoryRelativeWrapped(backing, path) != nullptr) { + return FileSys::ResultPathAlreadyExists; + } // NOTE: This is inaccurate behavior. CreateDirectory is not recursive. // CreateDirectory should return PathNotFound if the parent directory does not exist. // This is here temporarily in order to have UMM "work" in the meantime.