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

Method IsDirectory

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

Source from the content-addressed store, hash-verified

1662}
1663
1664Status GcsFileSystem::IsDirectory(const string& fname) {
1665 string bucket, object;
1666 TF_RETURN_IF_ERROR(ParseGcsPath(fname, true, &bucket, &object));
1667 if (object.empty()) {
1668 bool is_bucket;
1669 TF_RETURN_IF_ERROR(BucketExists(bucket, &is_bucket));
1670 if (is_bucket) {
1671 return Status::OK();
1672 }
1673 return errors::NotFound("The specified bucket gs://", bucket,
1674 " was not found.");
1675 }
1676 bool is_folder;
1677 TF_RETURN_IF_ERROR(FolderExists(fname, &is_folder));
1678 if (is_folder) {
1679 return Status::OK();
1680 }
1681 bool is_object;
1682 TF_RETURN_IF_ERROR(ObjectExists(fname, bucket, object, &is_object));
1683 if (is_object) {
1684 return errors::FailedPrecondition("The specified path ", fname,
1685 " is not a directory.");
1686 }
1687 return errors::NotFound("The specified path ", fname, " was not found.");
1688}
1689
1690Status GcsFileSystem::DeleteRecursively(const string& dirname,
1691 int64* undeleted_files,

Callers 3

TESTFunction · 0.45
GetRunfilesDirMethod · 0.45
GetRunfilesDirMethod · 0.45

Calls 4

ParseGcsPathFunction · 0.85
NotFoundFunction · 0.85
FailedPreconditionFunction · 0.85
emptyMethod · 0.45

Tested by 1

TESTFunction · 0.36