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

Function DeleteDirEntryDir

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

Remove a directory entry that's always a directory

Source from the content-addressed store, hash-verified

813
814// Remove a directory entry that's always a directory
815Status DeleteDirEntryDir(const PlatformFilename& path, const WIN32_FIND_DATAW& entry,
816 bool remove_top_dir = true) {
817 if ((entry.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) == 0) {
818 // It's a directory that doesn't have a reparse point => recurse
819 RETURN_NOT_OK(DeleteDirTreeInternal(path));
820 }
821 if (remove_top_dir) {
822 // Remove now empty directory or reparse point (e.g. symlink to dir)
823 if (!RemoveDirectoryW(path.ToNative().c_str())) {
824 return IOErrorFromWinError(GetLastError(), "Cannot delete directory entry '",
825 path.ToString(), "': ");
826 }
827 }
828 return Status::OK();
829}
830
831Status DeleteDirEntry(const PlatformFilename& path, const WIN32_FIND_DATAW& entry) {
832 if ((entry.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) {

Callers 2

DeleteDirEntryFunction · 0.85
DeleteDirContentsFunction · 0.85

Calls 5

DeleteDirTreeInternalFunction · 0.85
IOErrorFromWinErrorFunction · 0.85
IOErrorFromErrnoFunction · 0.85
OKFunction · 0.50
ToStringMethod · 0.45

Tested by

no test coverage detected