diff options
Diffstat (limited to 'src/filesystem/path.cc')
-rw-r--r-- | src/filesystem/path.cc | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/filesystem/path.cc b/src/filesystem/path.cc index ac780c4..c090791 100644 --- a/src/filesystem/path.cc +++ b/src/filesystem/path.cc @@ -6,13 +6,7 @@ // project headers #include "filesystem/path.h" -#include "common/common.h" - -#ifdef _WIN32 -#include <dlfcn.h> -#else -#include <sys/stat.h> -#endif +#include "sys/sys.h" namespace filesystem { @@ -21,14 +15,10 @@ void Path::create(std::string path) { if (tmp[tmp.size()-1] == '/') tmp = tmp.substr(0, tmp.size() - 1); -#ifdef _WIN32 - mkdir(tmp.c_str()); -#else - if (!mkdir(tmp.c_str(), 0777)) - con_warn << "Could not create directory " << tmp << std::endl; + if (!sys::mkdir(tmp.c_str())) + con_warn << "could not create directory " << tmp << std::endl; else - con_debug << "Path created " << tmp << std::endl; -#endif + con_debug << "directory created " << tmp << std::endl; } bool Path::exists(std::string path) { |