From 937444ee94233b4be4ad87ef813662220013401c Mon Sep 17 00:00:00 2001 From: TotallyNotElite <1yourexperiment@protonmail.com> Date: Sun, 1 Mar 2020 13:49:44 +0100 Subject: [PATCH] avoid std::filesystem causes issues on ubuntu 18.04 --- src/pathio.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pathio.cpp b/src/pathio.cpp index d09ef134..5ba213c4 100755 --- a/src/pathio.cpp +++ b/src/pathio.cpp @@ -8,7 +8,6 @@ #include "common.hpp" #include -#include // Cached data path std::optional cached_data_path; @@ -20,13 +19,15 @@ std::string getDataPath(std::string subpath) { if (!cached_data_path) { + DIR *dir; if (std::getenv("CH_DATA_PATH")) { cached_data_path = std::getenv("CH_DATA_PATH"); } - else if (std::filesystem::exists(DATA_PATH)) + else if ((dir = opendir("mydir"))) { cached_data_path = DATA_PATH; + closedir(dir); } else {