From 9059147974ffbe2bea55b9c2136307a77f465835 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 15 Jan 2022 22:45:11 +0000 Subject: Replace uses of the FileSystem class with std::filesystem. --- src/inspircd.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/inspircd.cpp') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 61403cc7a..4b799a62b 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -32,7 +32,14 @@ */ +#include +#include +#include + #include "inspircd.h" +#include "exitcodes.h" +#include "xline.h" + #include #ifndef _WIN32 @@ -49,11 +56,6 @@ WindowsStream StandardOutput(STD_OUTPUT_HANDLE); #endif -#include -#include -#include "xline.h" -#include "exitcodes.h" - InspIRCd* ServerInstance = NULL; /** Separate from the other casemap tables so that code *can* still exclusively rely on RFC casemapping @@ -204,14 +206,15 @@ namespace // Locates a config file on the file system. bool FindConfigFile(std::string& path) { - if (FileSystem::FileExists(path)) + std::error_code ec; + if (std::filesystem::is_regular_file(path, ec)) return true; #ifdef _WIN32 // Windows hides file extensions by default so try appending .txt to the path // to help users who have that feature enabled and can't create .conf files. const std::string txtpath = path + ".txt"; - if (FileSystem::FileExists(txtpath)) + if (std::filesystem::is_regular_file(txtpath, ec)) { path.assign(txtpath); return true; -- cgit v1.3.1-10-gc9f91