diff --git a/common/file.cpp b/common/file.cpp index 632d1696b..effed63b0 100644 --- a/common/file.cpp +++ b/common/file.cpp @@ -38,21 +38,21 @@ #include #include #include +#include namespace fs = std::filesystem; -/** - * @param name - * @return - */ + bool File::Exists(const std::string &name) { - return fs::exists(fs::path{name}); + struct stat sb{}; + if (stat(name.c_str(), &sb) == 0) { + return true; + } + + return false; } -/** - * @param directory_name - */ void File::Makedir(const std::string &directory_name) { try {