From faff22736587e0bea30b538deee69a9c3d459a1a Mon Sep 17 00:00:00 2001 From: kelson42 Date: Sat, 10 Dec 2011 18:52:11 +0000 Subject: [PATCH] + port makeDirectory to WIN32 --- src/common/pathTools.cpp | 4 ++++ src/common/pathTools.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/common/pathTools.cpp b/src/common/pathTools.cpp index 19d618d14..f1ca7d222 100644 --- a/src/common/pathTools.cpp +++ b/src/common/pathTools.cpp @@ -105,7 +105,11 @@ bool fileExists(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); +#endif return status == 0; } diff --git a/src/common/pathTools.h b/src/common/pathTools.h index f87155a77..55fa3f58b 100644 --- a/src/common/pathTools.h +++ b/src/common/pathTools.h @@ -30,6 +30,10 @@ #include #include +#ifdef _WIN32 +#include +#endif + using namespace std; bool isRelativePath(const string &path);