mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
sceIoRename() ignores any path on dest.
Also, change the interface so it can return an error code. Currently not returning perfect error codes but it's better than before.
This commit is contained in:
1 parent
6a9e6ce5fe
commit
c8ee2c0739
7 files changed
+52
-21
No files matched your search
@@ -374,18 +374,34 @@ bool MetaFileSystem::RmDir(const std::string &dirname)
|
||||
}
|
||||
}
|
||||
|
||||
bool MetaFileSystem::RenameFile(const std::string &from, const std::string &to)
|
||||
int MetaFileSystem::RenameFile(const std::string &from, const std::string &to)
|
||||
{
|
||||
std::string of;
|
||||
std::string rf;
|
||||
IFileSystem *system;
|
||||
if (MapFilePath(from, of, &system) && MapFilePath(to, rf, &system))
|
||||
IFileSystem *osystem;
|
||||
IFileSystem *rsystem = NULL;
|
||||
if (MapFilePath(from, of, &osystem))
|
||||
{
|
||||
return system->RenameFile(of, rf);
|
||||
// If it's a relative path, it seems to always use from's filesystem.
|
||||
if (to.find(':/') != to.npos)
|
||||
{
|
||||
if (!MapFilePath(to, rf, &rsystem))
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
rf = to;
|
||||
rsystem = osystem;
|
||||
}
|
||||
|
||||
if (osystem != rsystem)
|
||||
return SCE_KERNEL_ERROR_XDEV;
|
||||
|
||||
return osystem->RenameFile(of, rf);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user