MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / FileOrDirectoryExists

Method FileOrDirectoryExists

rtpose_wrapper/src/gtest/gtest-all.cpp:7629–7639  ·  view source on GitHub ↗

Returns true if pathname describes something findable in the file-system, either a file, directory, or whatever.

Source from the content-addressed store, hash-verified

7627// Returns true if pathname describes something findable in the file-system,
7628// either a file, directory, or whatever.
7629bool FilePath::FileOrDirectoryExists() const {
7630#if GTEST_OS_WINDOWS_MOBILE
7631 LPCWSTR unicode = String::AnsiToUtf16(pathname_.c_str());
7632 const DWORD attributes = GetFileAttributes(unicode);
7633 delete [] unicode;
7634 return attributes != kInvalidFileAttributes;
7635#else
7636 posix::StatStruct file_stat;
7637 return posix::Stat(pathname_.c_str(), &file_stat) == 0;
7638#endif // GTEST_OS_WINDOWS_MOBILE
7639}
7640
7641// Returns true if pathname describes a directory in the file-system
7642// that exists.

Callers 1

Calls 1

StatFunction · 0.85

Tested by

no test coverage detected