Create fio wrapper for rename file

This commit is contained in:
Jonathan G Rennison
2023-07-09 12:42:35 +01:00
parent f190b9815a
commit f6e8ea059d
4 changed files with 11 additions and 2 deletions

View File

@@ -360,6 +360,15 @@ void FioCreateDirectory(const std::string &name)
#endif
}
void FioRenameFile(const std::string &oldname, const std::string &newname)
{
#if defined(_WIN32)
_wrename(OTTD2FS(oldname).c_str(), OTTD2FS(newname).c_str());
#else
rename(oldname.c_str(), newname.c_str());
#endif
}
/**
* Appends, if necessary, the path separator character to the end of the string.
* It does not add the path separator to zero-sized strings.