Skip to contents

Download a file

Usage

aws_file_download(remote_path, path, ...)

Arguments

remote_path

(character) one or more remote S3 paths. required

path

(character) one or more file paths to write to. required

...

named parameters passed on to s3fs::s3_file_download()

Value

(character) a vector of local file paths

Examples

if (FALSE) { # \dontrun{
tfile <- tempfile()
aws_file_download(remote_path = "s3://s64-test-2/DESCRIPTION", path = tfile)

# many files
tfiles <- replicate(n = 3, tempfile())
aws_file_download(
  remote_path =
    s3_path("s64-test-2", c("a_file", "c_file", "d_file")), path = tfiles
)

## length of `remote_path` and `path` must be the same
tfiles <- replicate(n = 2, tempfile())
aws_file_download(
  remote_path =
    s3_path("s64-test-2", c("a_file", "c_file", "d_file")), path = tfiles
)

# S3 file does not exist
temp_path <- tempfile()
aws_file_download(s3_path("s64-test-2", "TESTING123"), temp_path)
} # }