MCPcopy Create free account
hub / github.com/apache/arrow / Move

Method Move

cpp/src/arrow/filesystem/gcsfs.cc:573–592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

571 }
572
573 Status Move(const GcsPath& src, const GcsPath& dest) {
574 if (src == dest) return Status::OK();
575 if (src.object.empty()) {
576 return Status::IOError(
577 "Moving directories or buckets cannot be implemented in GCS. You provided (",
578 src.full_path, ") as a source for Move()");
579 }
580 ARROW_ASSIGN_OR_RAISE(auto info, GetFileInfo(dest));
581 if (info.IsDirectory()) {
582 return Status::IOError("Attempting to Move() '", info.path(),
583 "' to an existing directory");
584 }
585 ARROW_ASSIGN_OR_RAISE(auto src_info, GetFileInfo(src));
586 if (!src_info.IsFile()) {
587 return Status::IOError("Cannot move source '", src.full_path,
588 "' the object does not exist or does not represent a file");
589 }
590 RETURN_NOT_OK(CopyFile(src, dest));
591 return DeleteFile(src);
592 }
593
594 Status CopyFile(const GcsPath& src, const GcsPath& dest) {
595 auto parent = dest.parent();

Callers

nothing calls this directly

Calls 8

IOErrorFunction · 0.85
CopyFileFunction · 0.85
DeleteFileFunction · 0.85
IsFileMethod · 0.80
OKFunction · 0.50
emptyMethod · 0.45
IsDirectoryMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected