+ port makeDirectory to WIN32

This commit is contained in:
kelson42 2011-12-10 18:52:11 +00:00
parent 8df9c53878
commit faff227365
2 changed files with 8 additions and 0 deletions

View File

@ -105,7 +105,11 @@ bool fileExists(const string &path) {
} }
bool makeDirectory(const string &path) { bool makeDirectory(const string &path) {
#ifdef _WIN32
int status = _mkdir(path.c_str());
#else
int status = mkdir(path.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); int status = mkdir(path.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
#endif
return status == 0; return status == 0;
} }

View File

@ -30,6 +30,10 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <ios> #include <ios>
#ifdef _WIN32
#include <direct.h>
#endif
using namespace std; using namespace std;
bool isRelativePath(const string &path); bool isRelativePath(const string &path);