diff options
Diffstat (limited to 'src/common/path.cc')
-rw-r--r-- | src/common/path.cc | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/common/path.cc b/src/common/path.cc new file mode 100644 index 0000000..d9fc332 --- /dev/null +++ b/src/common/path.cc @@ -0,0 +1,40 @@ +/* + common/path.cc + This file is part of the Osirion project and is distributed under + the terms of the GNU General Public License version 2 +*/ + +// project headers +#include "path.h" +#include "console.h" + +#ifdef _WIN32 +#include <dlfcn.h> +#else +#include <sys/stat.h> +#endif + +namespace common { + +void Path::create(std::string path) +{ + std::string tmp(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)) + conwarn << "Could not create directory " << tmp << std::endl; + else + condebug << "Path created " << tmp << std::endl; +#endif +} + +bool Path::exists(std::string path) +{ + return false; +} + +} |