aws_file_exists | R Documentation |
Check if a file exists
aws_file_exists(remote_path)
remote_path |
(character) one or more remote S3 paths. required |
vector of booleans (TRUE
or FALSE
), length matches
length(remote_path)
Other files:
aws_file_attr()
,
aws_file_copy()
,
aws_file_delete()
,
aws_file_download()
,
aws_file_rename()
,
aws_file_upload()
,
six_file_upload()
library(glue)
bucket <- random_bucket()
aws_bucket_create(bucket)
# upload some files
tfiles <- replicate(n = 3, tempfile())
paths <- s3_path(bucket, glue("{basename(tfiles)}.txt"))
for (file in tfiles) cat("Hello saturn!!!!!!\n", file = file)
for (file in tfiles) print(readLines(file))
aws_file_upload(path = tfiles, remote_path = paths)
# check that files exist
aws_file_exists(paths[1])
aws_file_exists(paths[2])
aws_file_exists(s3_path(bucket, "doesnotexist.txt"))
# Cleanup
six_bucket_delete(bucket, force = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.