mirror of
https://github.com/google-ai-edge/mediapipe.git
synced 2024-08-21 00:08:10 +08:00
Fix mediapipe::file::Exists() for >2GB files on Windows.
PiperOrigin-RevId: 660497728
This commit is contained in:
parent
0ed6e57b90
commit
14b8a02c13
@ -259,9 +259,14 @@ absl::Status MatchFileTypeInDirectory(const std::string& directory,
|
||||
}
|
||||
|
||||
absl::Status Exists(absl::string_view file_name) {
|
||||
#ifdef _WIN32
|
||||
// Windows needs to use stat64 for >2GB files.
|
||||
struct _stat64 buffer;
|
||||
int status = _stat64(std::string(file_name).c_str(), &buffer);
|
||||
#else
|
||||
struct stat buffer;
|
||||
int status;
|
||||
status = stat(std::string(file_name).c_str(), &buffer);
|
||||
int status = stat(std::string(file_name).c_str(), &buffer);
|
||||
#endif
|
||||
if (status == 0) {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user