aws_file_attr | R Documentation |
File attributes
aws_file_attr(remote_path)
remote_path |
(character) one or more remote S3 paths. required |
a tibble with many columns, with number of rows matching length
of remote_path
uses s3fs::s3_file_info()
internally
Other files:
aws_file_copy()
,
aws_file_delete()
,
aws_file_download()
,
aws_file_exists()
,
aws_file_rename()
,
aws_file_upload()
,
six_file_upload()
library(glue)
bucket <- random_bucket()
if (!aws_bucket_exists(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)
# files one by one
aws_file_attr(paths[1])
aws_file_attr(paths[2])
aws_file_attr(paths[3])
# or all together
aws_file_attr(paths)
# 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.