From f27785446f53b3edc0b437eb8d4792625ad8fc98 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Thu, 30 Jan 2014 13:10:39 +0000 Subject: [PATCH] pp --- Common/OS.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Common/OS.cpp b/Common/OS.cpp index 6a6a91b8ea..ad3127a9ce 100644 --- a/Common/OS.cpp +++ b/Common/OS.cpp @@ -352,19 +352,14 @@ int CreateDirectory(const std::string &dirName) void CreatePath(const std::string &fullPath) { - size_t lastp = fullPath.find_last_of('/'); //TODO ?? win ==> backslash ?? - if(lastp == std::string::npos) return; - std::string dirname = std::string(fullPath, 0, lastp); - size_t cur = 0; - while(cur != std::string::npos) { - cur = dirname.find("/", cur + 1); - CreateDirectory( dirname.substr(0,cur) ); -/*#if defined(WIN32) && !defined(__CYGWIN__) - mkdir(dirname.substr(0,cur).c_str()); -#else - mkdir(dirname.substr(0,cur).c_str(),S_IRWXG|S_IRWXU); -#endif*/ - } + size_t lastp = fullPath.find_last_of('/'); // TODO: handle backslash for win? + if(lastp == std::string::npos) return; + std::string dirname = std::string(fullPath, 0, lastp); + size_t cur = 0; + while(cur != std::string::npos) { + cur = dirname.find("/", cur + 1); + CreateDirectory(dirname.substr(0, cur)); + } } int KillProcess(int pid) -- GitLab