Skip to content
Snippets Groups Projects
Commit f2778544 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

pp

parent d5acd13b
Branches
Tags
No related merge requests found
...@@ -352,18 +352,13 @@ int CreateDirectory(const std::string &dirName) ...@@ -352,18 +352,13 @@ int CreateDirectory(const std::string &dirName)
void CreatePath(const std::string &fullPath) void CreatePath(const std::string &fullPath)
{ {
size_t lastp = fullPath.find_last_of('/'); //TODO ?? win ==> backslash ?? size_t lastp = fullPath.find_last_of('/'); // TODO: handle backslash for win?
if(lastp == std::string::npos) return; if(lastp == std::string::npos) return;
std::string dirname = std::string(fullPath, 0, lastp); std::string dirname = std::string(fullPath, 0, lastp);
size_t cur = 0; size_t cur = 0;
while(cur != std::string::npos) { while(cur != std::string::npos) {
cur = dirname.find("/", cur + 1); cur = dirname.find("/", cur + 1);
CreateDirectory(dirname.substr(0, cur)); 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*/
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment