From 24fdd24808853bdc018e379c6a3d5624cd99804c Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Thu, 7 Nov 2019 21:10:59 +0300 Subject: [PATCH] Fix vfs::host::remove_all Separate WIN32-specific logic. Don't call fs::remove_all on WIN32 path. --- rpcs3/Emu/VFS.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/VFS.cpp b/rpcs3/Emu/VFS.cpp index fdb20f901f..bcda050e60 100644 --- a/rpcs3/Emu/VFS.cpp +++ b/rpcs3/Emu/VFS.cpp @@ -609,6 +609,7 @@ bool vfs::host::unlink(const std::string& path, const std::string& dev_root) bool vfs::host::remove_all(const std::string& path, const std::string& dev_root, bool remove_root) { +#ifdef _WIN32 if (remove_root) { // Rename to special dummy folder which will be ignored by VFS (but opened file handles can still read or write it) @@ -619,7 +620,12 @@ bool vfs::host::remove_all(const std::string& path, const std::string& dev_root, return false; } - if (!fs::remove_all(dummy)) + if (!vfs::host::remove_all(dummy, dev_root, false)) + { + return false; + } + + if (!fs::remove_dir(dummy)) { return false; } @@ -658,4 +664,7 @@ bool vfs::host::remove_all(const std::string& path, const std::string& dev_root, } return true; +#else + return fs::remove_all(path, remove_root); +#endif }