avoid std::filesystem
causes issues on ubuntu 18.04
This commit is contained in:
parent
6d1d8857fc
commit
937444ee94
@ -8,7 +8,6 @@
|
|||||||
#include "common.hpp"
|
#include "common.hpp"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <filesystem>
|
|
||||||
|
|
||||||
// Cached data path
|
// Cached data path
|
||||||
std::optional<std::string> cached_data_path;
|
std::optional<std::string> cached_data_path;
|
||||||
@ -20,13 +19,15 @@ std::string getDataPath(std::string subpath)
|
|||||||
{
|
{
|
||||||
if (!cached_data_path)
|
if (!cached_data_path)
|
||||||
{
|
{
|
||||||
|
DIR *dir;
|
||||||
if (std::getenv("CH_DATA_PATH"))
|
if (std::getenv("CH_DATA_PATH"))
|
||||||
{
|
{
|
||||||
cached_data_path = 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;
|
cached_data_path = DATA_PATH;
|
||||||
|
closedir(dir);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user