mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-09 00:14:56 +00:00
Implement vfs::host::rename
With spurious access error workaround
This commit is contained in:
parent
3354f068fc
commit
9736773c04
5 changed files with 28 additions and 9 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#include "stdafx.h"
|
||||
#include "IdManager.h"
|
||||
#include "System.h"
|
||||
#include "VFS.h"
|
||||
|
||||
#include "Utilities/mutex.h"
|
||||
|
|
@ -447,3 +448,17 @@ std::string vfs::unescape(std::string_view path)
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool vfs::host::rename(const std::string& from, const std::string& to, bool overwrite)
|
||||
{
|
||||
while (!fs::rename(from, to, overwrite))
|
||||
{
|
||||
// Try to ignore access error in order to prevent spurious failure
|
||||
if (Emu.IsStopped() || fs::g_tls_error != fs::error::acces)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue