sys_fs bugfixes

This commit is contained in:
Nekotekina 2015-03-16 19:20:02 +03:00
parent 7ce45a3bae
commit bee6b84733
7 changed files with 118 additions and 65 deletions

View file

@ -125,10 +125,15 @@ bool rRename(const std::string &from, const std::string &to)
{
// TODO: Deal with case-sensitivity
#ifdef _WIN32
return (MoveFile(ConvertUTF8ToWString(from).c_str(), ConvertUTF8ToWString(to).c_str()) == TRUE);
if (!MoveFile(ConvertUTF8ToWString(from).c_str(), ConvertUTF8ToWString(to).c_str()))
#else
return (0 == rename(from.c_str(), to.c_str()));
if (rename(from.c_str(), to.c_str()))
#endif
{
LOG_ERROR(GENERAL, "Error renaming '%s' to '%s': 0x%llx", from.c_str(), to.c_str(), (u64)GET_API_ERROR);
return false;
}
return true;
}
bool rExists(const std::string &file)