Copy files between buckets
Arguments
- remote_path
(character) one or more remote S3 paths. required
- bucket
(character) bucket to copy files to. required. if the bucket does not exist we prompt you asking if you'd like the bucket to be created
- force
(logical) force bucket creation without going through the prompt. default:
FALSE
. Should only be set toTRUE
when required for non-interactive use.- ...
named parameters passed on to
s3fs::s3_file_copy()
See also
Other files:
aws_file_attr()
,
aws_file_delete()
,
aws_file_download()
,
aws_file_exists()
,
aws_file_rename()
,
aws_file_upload()
,
six_file_upload()
Examples
if (FALSE) { # \dontrun{
# create files in an existing bucket
tfiles <- replicate(n = 3, tempfile())
for (i in tfiles) cat("Hello\nWorld\n", file = i)
paths <- s3_path("s64-test-2", c("aaa", "bbb", "ccc"), ext = "txt")
aws_file_upload(tfiles, paths)
# create a new bucket
new_bucket <- aws_bucket_create(bucket = "s64-test-3")
# add existing files to the new bucket
aws_file_copy(paths, path_as_s3(new_bucket))
# create bucket that doesn't exist yet
aws_file_copy(paths, "s64-test-4")
} # }