| 192 | } |
| 193 | |
| 194 | bool DiskUtils::makeDirectory(const Path& path, bool createIntermediates) { |
| 195 | if (createIntermediates && path.getComponents().size() > 1) { |
| 196 | auto parentPath = path.removingLastComponent(); |
| 197 | if (!isDirectory(parentPath) && !makeDirectory(path.removingLastComponent(), true)) { |
| 198 | return false; |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | auto pathStr = path.toString(); |
| 203 | return mkdir(pathStr.c_str(), S_IRWXU | S_IRWXG | S_IRWXO) >= 0; |
| 204 | } |
| 205 | |
| 206 | bool DiskUtils::remove(const Path& path) { |
| 207 | auto pathStr = path.toString(); |
nothing calls this directly
no test coverage detected