| 219 | |
| 220 | |
| 221 | bool createDirectory(const std::string& dirname) |
| 222 | { |
| 223 | std::string pth = CPLCleanTrailingSlash(dirname.c_str()); |
| 224 | if (VSIMkdir(pth.c_str(), 0755) != 0) |
| 225 | { |
| 226 | if (errno == EEXIST) |
| 227 | return false; |
| 228 | else |
| 229 | { |
| 230 | std::stringstream ss; |
| 231 | ss << "Unable to create directory " << dirname << std::endl << VSIStrerror(errno); |
| 232 | throw std::runtime_error(ss.str()); |
| 233 | } |
| 234 | } |
| 235 | else |
| 236 | return true; |
| 237 | } |
| 238 | |
| 239 | |
| 240 | bool createDirectories(const std::string& dirname) |