Migrate destructive calls of File::CopyDir() to File::Move().
This commit is contained in:
parent
5367bf394c
commit
4f462b4ef6
|
@ -121,7 +121,7 @@ void WFSIDevice::FinalizePatchInstall()
|
||||||
const std::string current_title_dir = fmt::format("/vol/{}/title/{}/{}", m_device_name,
|
const std::string current_title_dir = fmt::format("/vol/{}/title/{}/{}", m_device_name,
|
||||||
m_current_group_id_str, m_current_title_id_str);
|
m_current_group_id_str, m_current_title_id_str);
|
||||||
const std::string patch_dir = current_title_dir + "/_patch";
|
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)
|
std::optional<IPCReply> WFSIDevice::IOCtl(const IOCtlRequest& request)
|
||||||
|
|
|
@ -197,7 +197,7 @@ static void MoveToBackupIfExists(const std::string& path)
|
||||||
{
|
{
|
||||||
if (File::Exists(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);
|
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
|
// 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::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
|
// copy back the temp nand redirected files to where they should normally be redirected to
|
||||||
for (const auto& redirect : s_temp_nand_redirects)
|
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();
|
IOS::HLE::EmulationKernel* ios = IOS::HLE::GetIOS();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue