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

Function DeleteDirContents

cpp/src/arrow/util/io_util.cc:852–866  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

850}
851
852Result<bool> DeleteDirContents(const PlatformFilename& dir_path, bool allow_not_found,
853 bool remove_top_dir) {
854 bool exists = true;
855 WIN32_FIND_DATAW entry;
856 if (allow_not_found) {
857 RETURN_NOT_OK(FindOneFile(dir_path, &entry, &exists));
858 } else {
859 // Will raise if dir_path does not exist
860 RETURN_NOT_OK(FindOneFile(dir_path, &entry));
861 }
862 if (exists) {
863 RETURN_NOT_OK(DeleteDirEntryDir(dir_path, entry, remove_top_dir));
864 }
865 return exists;
866}
867
868#else // POSIX
869

Callers 2

TESTFunction · 0.70
DeleteDirTreeFunction · 0.70

Calls 5

FindOneFileFunction · 0.85
DeleteDirEntryDirFunction · 0.85
LinkStatFunction · 0.85
IOErrorFunction · 0.85
ToStringMethod · 0.45

Tested by 1

TESTFunction · 0.56