| 320 | } |
| 321 | |
| 322 | Status CheckForDirectory(const std::string& path, const char* action) { |
| 323 | // Check existence of path, and that it's a directory |
| 324 | HdfsPathInfo info; |
| 325 | RETURN_NOT_OK(GetPathInfoStatus(path, &info)); |
| 326 | if (info.kind != FileType::Directory) { |
| 327 | return Status::IOError("Cannot ", action, " directory '", path, |
| 328 | "': not a directory"); |
| 329 | } |
| 330 | return Status::OK(); |
| 331 | } |
| 332 | |
| 333 | Status GetChildren(const std::string& path, std::vector<std::string>* listing) { |
| 334 | std::vector<HdfsPathInfo> detailed_listing; |