1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-27 08:29:11 +00:00

Codechange: Use std::filesystem::exists instead of access. (#12702)

This commit is contained in:
2024-05-22 09:23:01 +01:00
committed by GitHub
parent 5bc3723bcc
commit 19ca4089a1

View File

@@ -16,7 +16,6 @@
#include "tar_type.h"
#ifdef _WIN32
#include <windows.h>
# define access _taccess
#elif defined(__HAIKU__)
#include <Path.h>
#include <storage/FindDirectory.h>
@@ -135,7 +134,8 @@ bool FioCheckFileExists(const std::string &filename, Subdirectory subdir)
*/
bool FileExists(const std::string &filename)
{
return access(OTTD2FS(filename).c_str(), 0) == 0;
std::error_code ec;
return std::filesystem::exists(OTTD2FS(filename), ec);
}
/**