Codechange: Introduce FioRemove() to remove files. (#12491)

New function FioRemove() handles OTTD2FS conversion, and uses std::filesystem::remove instead of unlink, all in one location.
This commit is contained in:
Peter Nelson
2024-04-14 23:43:50 +01:00
committed by GitHub
parent 29e932e087
commit 4eaeccdaeb
7 changed files with 25 additions and 14 deletions

View File

@@ -246,8 +246,7 @@ std::string FiosMakeHeightmapName(const char *name)
*/
bool FiosDelete(const char *name)
{
std::string filename = FiosMakeSavegameName(name);
return unlink(filename.c_str()) == 0;
return FioRemove(FiosMakeSavegameName(name));
}
typedef std::tuple<FiosType, std::string> FiosGetTypeAndNameProc(SaveLoadOperation fop, const std::string &filename, const std::string_view ext);