aboutsummaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-01-15 22:45:11 +0000
committerGravatar Sadie Powell2022-01-15 23:20:45 +0000
commit9059147974ffbe2bea55b9c2136307a77f465835 (patch)
treedd5e8a4a0634d4a9afbf14813c8779f7839f99f5 /src/inspircd.cpp
parentMerge branch 'insp3' into master. (diff)
Replace uses of the FileSystem class with std::filesystem.
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp17
1 files changed, 10 insertions, 7 deletions
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 <filesystem>
+#include <fstream>
+#include <iostream>
+
#include "inspircd.h"
+#include "exitcodes.h"
+#include "xline.h"
+
#include <signal.h>
#ifndef _WIN32
@@ -49,11 +56,6 @@
WindowsStream StandardOutput(STD_OUTPUT_HANDLE);
#endif
-#include <fstream>
-#include <iostream>
-#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;