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

Method DeleteDirContents

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

Source from the content-addressed store, hash-verified

207 }
208
209 Status DeleteDirContents(const std::string& path, bool missing_dir_ok) {
210 auto st = CheckForDirectory(path, "delete contents of");
211 if (!st.ok()) {
212 if (missing_dir_ok && ErrnoFromStatus(st) == ENOENT) {
213 return Status::OK();
214 }
215 return st;
216 }
217
218 std::vector<std::string> file_list;
219 RETURN_NOT_OK(client_->GetChildren(path, &file_list));
220 for (const auto& file : file_list) {
221 RETURN_NOT_OK(client_->Delete(file, /*recursive=*/true));
222 }
223 return Status::OK();
224 }
225
226 Status DeleteFile(const std::string& path) {
227 if (IsDirectory(path)) {

Callers

nothing calls this directly

Calls 5

ErrnoFromStatusFunction · 0.70
OKFunction · 0.50
okMethod · 0.45
GetChildrenMethod · 0.45
DeleteMethod · 0.45

Tested by

no test coverage detected