| 592 | } |
| 593 | |
| 594 | Status CopyFile(const GcsPath& src, const GcsPath& dest) { |
| 595 | auto parent = dest.parent(); |
| 596 | if (!parent.object.empty()) { |
| 597 | ARROW_ASSIGN_OR_RAISE(auto parent_info, GetFileInfo(parent)); |
| 598 | if (parent_info.IsFile()) { |
| 599 | return Status::IOError("Cannot use file '", parent.full_path, |
| 600 | "' as a destination directory"); |
| 601 | } |
| 602 | } |
| 603 | auto metadata = |
| 604 | client_.RewriteObjectBlocking(src.bucket, src.object, dest.bucket, dest.object); |
| 605 | return internal::ToArrowStatus(metadata.status()); |
| 606 | } |
| 607 | |
| 608 | Result<std::shared_ptr<GcsInputStream>> OpenInputStream(const GcsPath& path, |
| 609 | gcs::Generation generation, |