| 238 | |
| 239 | |
| 240 | bool createDirectories(const std::string& dirname) |
| 241 | { |
| 242 | std::string pth = CPLCleanTrailingSlash(dirname.c_str()); |
| 243 | if (VSIMkdirRecursive(pth.c_str(), 0755) != 0) |
| 244 | { |
| 245 | if (errno == EEXIST) |
| 246 | return false; |
| 247 | else |
| 248 | { |
| 249 | std::stringstream ss; |
| 250 | ss << "Unable to create directories " << dirname << std::endl << VSIStrerror(errno); |
| 251 | throw std::runtime_error(ss.str()); |
| 252 | } |
| 253 | } |
| 254 | else |
| 255 | return true; |
| 256 | } |
| 257 | |
| 258 | |
| 259 | void deleteDirectory(const std::string& dirname) |