| 94 | } |
| 95 | |
| 96 | void mkdir_parent (const std::string& path) |
| 97 | { |
| 98 | std::string::size_type slash(path.find('/', 1)); |
| 99 | while (slash != std::string::npos) { |
| 100 | std::string prefix(path.substr(0, slash)); |
| 101 | if (GetFileAttributes(prefix.c_str()) == INVALID_FILE_ATTRIBUTES) { |
| 102 | // prefix does not exist, so try to create it |
| 103 | if (!CreateDirectory(prefix.c_str(), nullptr)) { |
| 104 | throw System_error("CreateDirectory", prefix, GetLastError()); |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | slash = path.find('/', slash + 1); |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | std::string our_exe_path () |
| 113 | { |
nothing calls this directly
no test coverage detected