| 176 | } |
| 177 | |
| 178 | Status CreateDir(const std::string& path, bool recursive) { |
| 179 | if (IsDirectory(path)) { |
| 180 | return Status::OK(); |
| 181 | } |
| 182 | if (!recursive) { |
| 183 | const auto parent = GetAbstractPathParent(path).first; |
| 184 | if (!parent.empty() && !IsDirectory(parent)) { |
| 185 | return Status::IOError("Cannot create directory '", path, |
| 186 | "': parent is not a directory"); |
| 187 | } |
| 188 | } |
| 189 | RETURN_NOT_OK(client_->MakeDirectory(path)); |
| 190 | return Status::OK(); |
| 191 | } |
| 192 | |
| 193 | Status CheckForDirectory(const std::string& path, const char* action) { |
| 194 | // Check existence of path, and that it's a directory |
nothing calls this directly
no test coverage detected