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

Method RenameFile

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

Source from the content-addressed store, hash-verified

1602}
1603
1604Status GcsFileSystem::RenameFile(const string& src, const string& target) {
1605 if (!IsDirectory(src).ok()) {
1606 return RenameObject(src, target);
1607 }
1608 // Rename all individual objects in the directory one by one.
1609 std::vector<string> children;
1610 TF_RETURN_IF_ERROR(
1611 GetChildrenBounded(src, UINT64_MAX, &children, true /* recursively */,
1612 true /* include_self_directory_marker */));
1613 for (const string& subpath : children) {
1614 TF_RETURN_IF_ERROR(
1615 RenameObject(JoinGcsPath(src, subpath), JoinGcsPath(target, subpath)));
1616 }
1617 return Status::OK();
1618}
1619
1620// Uses a GCS API command to copy the object and then deletes the old one.
1621Status GcsFileSystem::RenameObject(const string& src, const string& target) {

Callers 1

TESTFunction · 0.45

Calls 2

JoinGcsPathFunction · 0.85
okMethod · 0.45

Tested by 1

TESTFunction · 0.36