Print a tree of the objects in a bucket
Arguments
- bucket
(character) bucket name; must be length 1. required
- recurse
(logical) returns all AWS S3 objects in lower sub directories, default:
TRUE
- ...
Additional arguments passed to
s3fs::s3_dir_tree()
See also
Other buckets:
aws_bucket_create()
,
aws_bucket_delete()
,
aws_bucket_download()
,
aws_bucket_exists()
,
aws_bucket_list_objects()
,
aws_bucket_upload()
,
aws_buckets()
,
six_bucket_delete()
Examples
if (FALSE) { # interactive()
bucket_name <- random_string("bucket")
if (!aws_bucket_exists(bucket_name)) aws_bucket_create(bucket_name)
links_file <- file.path(system.file(), "Meta/links.rds")
pkgs_file <- file.path(system.file(), "Meta/package.rds")
demo_file <- file.path(system.file(), "Meta/demo.rds")
aws_file_upload(
c(links_file, pkgs_file, demo_file),
s3_path(
bucket_name,
c(
basename(links_file),
basename(pkgs_file),
basename(demo_file)
)
)
)
aws_bucket_tree(bucket_name)
# cleanup
objs <- aws_bucket_list_objects(bucket_name)
aws_file_delete(objs$uri)
aws_bucket_delete(bucket_name, force = TRUE)
aws_bucket_exists(bucket_name)
}