mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-06-28 16:09:36 +01:00
Codechange: Use std::filesystem::exists instead of access. (#12702)
This commit is contained in:
parent
5bc3723bcc
commit
19ca4089a1
@ -16,7 +16,6 @@
|
|||||||
#include "tar_type.h"
|
#include "tar_type.h"
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
# define access _taccess
|
|
||||||
#elif defined(__HAIKU__)
|
#elif defined(__HAIKU__)
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
#include <storage/FindDirectory.h>
|
#include <storage/FindDirectory.h>
|
||||||
@ -135,7 +134,8 @@ bool FioCheckFileExists(const std::string &filename, Subdirectory subdir)
|
|||||||
*/
|
*/
|
||||||
bool FileExists(const std::string &filename)
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user