Returns true if pathname describes something findable in the file-system, either a file, directory, or whatever.
| 7627 | // Returns true if pathname describes something findable in the file-system, |
| 7628 | // either a file, directory, or whatever. |
| 7629 | bool 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. |
no test coverage detected