Rename a remote file
Arguments
- remote_path
(character) one or more remote S3 paths. required
- new_remote_path
(character) one or more remote S3 paths. required. length must match
remote_path
- ...
named parameters passed on to
s3fs::s3_file_move()
See also
Other files:
aws_file_attr()
,
aws_file_copy()
,
aws_file_delete()
,
aws_file_download()
,
aws_file_exists()
,
aws_file_upload()
,
six_file_upload()
Examples
if (FALSE) { # \dontrun{
aws_file_rename(
s3_path("s64-test-2", "DESCRIPTION"),
s3_path("s64-test-2", "DESC")
)
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)
new_paths <- s3_path("s64-test-2", c("new_aaa", "new_bbb", "new_ccc"),
ext = "txt"
)
aws_file_rename(paths, new_paths)
} # }