Skip to contents

Rename a remote file

Usage

aws_file_rename(remote_path, new_remote_path, ...)

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()

Value

vector of paths, length matches length(remote_path)

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)
} # }