aws_bucket_tree: Print a tree of the objects in a bucket

View source: R/bucket.R

aws_bucket_treeR Documentation

Print a tree of the objects in a bucket

Description

Print a tree of the objects in a bucket

Usage

aws_bucket_tree(bucket, recurse = TRUE, ...)

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

Value

character vector of objects/files within the bucket, printed as a 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(), six_bucket_upload()

Examples


bucket_name <- random_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)


sixtyfour documentation built on April 3, 2025, 8:22 p.m.