MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / FileExists

Method FileExists

tensorflow/core/platform/cloud/gcs_file_system.cc:1121–1146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1119}
1120
1121Status GcsFileSystem::FileExists(const string& fname) {
1122 string bucket, object;
1123 TF_RETURN_IF_ERROR(ParseGcsPath(fname, true, &bucket, &object));
1124 if (object.empty()) {
1125 bool result;
1126 TF_RETURN_IF_ERROR(BucketExists(bucket, &result));
1127 if (result) {
1128 return Status::OK();
1129 }
1130 }
1131
1132 // Check if the object exists.
1133 GcsFileStat stat;
1134 const Status status = StatForObject(fname, bucket, object, &stat);
1135 if (status.code() != errors::Code::NOT_FOUND) {
1136 return status;
1137 }
1138
1139 // Check if the folder exists.
1140 bool result;
1141 TF_RETURN_IF_ERROR(FolderExists(fname, &result));
1142 if (result) {
1143 return Status::OK();
1144 }
1145 return errors::NotFound("The specified path ", fname, " was not found.");
1146}
1147
1148Status GcsFileSystem::ObjectExists(const string& fname, const string& bucket,
1149 const string& object, bool* result) {

Callers 1

TESTFunction · 0.45

Calls 4

ParseGcsPathFunction · 0.85
NotFoundFunction · 0.85
emptyMethod · 0.45
codeMethod · 0.45

Tested by 1

TESTFunction · 0.36