diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2023-02-24 21:48:01 +0100 |
|---|---|---|
| committer | Admiral H. Curtiss <pikachu025@gmail.com> | 2023-02-26 23:17:10 +0100 |
| commit | 4f462b4ef6b274468b0e8d38e0c712b286cf69ae (patch) | |
| tree | 9f3082ae650516e0f2a23bc69a74fd20b99a5188 /Source/Core | |
| parent | 5367bf394c6092bed589bc4cdb06a2f0ab2c0f75 (diff) | |
Migrate destructive calls of File::CopyDir() to File::Move().
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/IOS/WFS/WFSI.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/Core/WiiRoot.cpp | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/Source/Core/Core/IOS/WFS/WFSI.cpp b/Source/Core/Core/IOS/WFS/WFSI.cpp index f1f66e1554..833052ce55 100644 --- a/Source/Core/Core/IOS/WFS/WFSI.cpp +++ b/Source/Core/Core/IOS/WFS/WFSI.cpp @@ -121,7 +121,7 @@ void WFSIDevice::FinalizePatchInstall() const std::string current_title_dir = fmt::format("/vol/{}/title/{}/{}", m_device_name, m_current_group_id_str, m_current_title_id_str); const std::string patch_dir = current_title_dir + "/_patch"; - File::CopyDir(WFS::NativePath(patch_dir), WFS::NativePath(current_title_dir), true); + File::MoveWithOverwrite(WFS::NativePath(patch_dir), WFS::NativePath(current_title_dir)); } std::optional<IPCReply> WFSIDevice::IOCtl(const IOCtlRequest& request) diff --git a/Source/Core/Core/WiiRoot.cpp b/Source/Core/Core/WiiRoot.cpp index 4c39619e43..7311a6b725 100644 --- a/Source/Core/Core/WiiRoot.cpp +++ b/Source/Core/Core/WiiRoot.cpp @@ -197,7 +197,7 @@ static void MoveToBackupIfExists(const std::string& path) { if (File::Exists(path)) { - const std::string backup_path = path.substr(0, path.size() - 1) + ".backup" DIR_SEP; + const std::string backup_path = path.substr(0, path.size() - 1) + ".backup"; WARN_LOG_FMT(IOS_FS, "Temporary directory at {} exists, moving to backup...", path); // If backup exists, delete it as we don't want a mess @@ -207,7 +207,7 @@ static void MoveToBackupIfExists(const std::string& path) File::DeleteDirRecursively(backup_path); } - File::CopyDir(path, backup_path, true); + File::MoveWithOverwrite(path, backup_path); } } @@ -399,7 +399,10 @@ void CleanUpWiiFileSystemContents(const BootSessionData& boot_session_data) // copy back the temp nand redirected files to where they should normally be redirected to for (const auto& redirect : s_temp_nand_redirects) - File::CopyDir(redirect.temp_path, redirect.real_path + "/", true); + { + File::CreateFullPath(redirect.real_path); + File::MoveWithOverwrite(redirect.temp_path, redirect.real_path); + } IOS::HLE::EmulationKernel* ios = IOS::HLE::GetIOS(); |
