From 28180e6b6763e4ce5d65c02e4df5380f11e6d10a Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 30 Jan 2008 17:29:25 +0000 Subject: filesystem subsystem --- src/filesystem/path.cc | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/filesystem/path.cc (limited to 'src/filesystem/path.cc') diff --git a/src/filesystem/path.cc b/src/filesystem/path.cc new file mode 100644 index 0000000..ac780c4 --- /dev/null +++ b/src/filesystem/path.cc @@ -0,0 +1,38 @@ +/* + filesystem/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 "filesystem/path.h" +#include "common/common.h" + +#ifdef _WIN32 +#include +#else +#include +#endif + +namespace filesystem { + +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)) + con_warn << "Could not create directory " << tmp << std::endl; + else + con_debug << "Path created " << tmp << std::endl; +#endif +} + +bool Path::exists(std::string path) { + return false; +} + +} -- cgit v1.2.3