MCPcopy Create free account
hub / github.com/apache/arrow / GetFileInfo

Method GetFileInfo

cpp/src/arrow/filesystem/hdfs.cc:69–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67 HdfsOptions options() const { return options_; }
68
69 Result<FileInfo> GetFileInfo(const std::string& path) {
70 // It has unfortunately been a frequent logic error to pass URIs down
71 // to GetFileInfo (e.g. ARROW-10264). Unlike other filesystems, HDFS
72 // silently accepts URIs but returns different results than if given the
73 // equivalent in-filesystem paths. Instead of raising cryptic errors
74 // later, notify the underlying problem immediately.
75 if (path.substr(0, 5) == "hdfs:") {
76 return Status::Invalid("GetFileInfo must not be passed a URI, got: ", path);
77 }
78 FileInfo info;
79 io::HdfsPathInfo path_info;
80 auto status = client_->GetPathInfo(path, &path_info);
81 info.set_path(path);
82 if (status.IsIOError()) {
83 info.set_type(FileType::NotFound);
84 return info;
85 }
86
87 PathInfoToFileInfo(path_info, &info);
88 return info;
89 }
90
91 Status StatSelector(const std::string& wd, const std::string& path,
92 const FileSelector& select, int nesting_depth,

Callers

nothing calls this directly

Calls 10

IOErrorFunction · 0.85
StatSelectorFunction · 0.85
substrMethod · 0.80
backMethod · 0.80
InvalidFunction · 0.50
GetPathInfoMethod · 0.45
GetWorkingDirectoryMethod · 0.45
emptyMethod · 0.45
findMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected