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

Function FindOneFile

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

Source from the content-addressed store, hash-verified

740}
741
742Status FindOneFile(const PlatformFilename& fn, WIN32_FIND_DATAW* find_data,
743 bool* exists = nullptr) {
744 HANDLE handle = FindFirstFileW(PathWithoutTrailingSlash(fn).c_str(), find_data);
745 if (handle == INVALID_HANDLE_VALUE) {
746 int errnum = GetLastError();
747 if (exists == nullptr ||
748 (errnum != ERROR_PATH_NOT_FOUND && errnum != ERROR_FILE_NOT_FOUND)) {
749 return IOErrorFromWinError(GetLastError(), "Cannot get information for path '",
750 fn.ToString(), "'");
751 }
752 *exists = false;
753 } else {
754 if (exists != nullptr) {
755 *exists = true;
756 }
757 FindHandleDeleter(&handle);
758 }
759 return Status::OK();
760}
761
762} // namespace
763

Callers 1

DeleteDirContentsFunction · 0.85

Calls 5

PathWithoutTrailingSlashFunction · 0.85
IOErrorFromWinErrorFunction · 0.85
FindHandleDeleterFunction · 0.85
OKFunction · 0.50
ToStringMethod · 0.45

Tested by

no test coverage detected