s3_ls: List objects in an S3 bucket.

View source: R/list.R

s3_lsR Documentation

List objects in an S3 bucket.

Description

List the items in an S3 bucket. Lots of time-saving filters are built-in, including the default use of a defined working directory and grep pattern matching. As with all functions in this package, you must first define your environment with s3_set().

Usage

s3_ls(..., recursive = FALSE, pattern = NULL, full.names = FALSE,
  files.only = FALSE, dir.only = FALSE, all.files = FALSE,
  full.response = FALSE, aws.args = NULL)

Arguments

...

flexible s3 path description of s3 location and object name. This is relative to your cwd (use s3_cd() to print your cwd). Accepts a character vector "top/next", separate character strings c("top", "next"), or lists list("top", "next").

recursive

logical, when enabled lists all files under the defined directory. Currently the return is not optimal, and returns a root-based path independent of cwd. For example: cwd=s3"//bucket/one/two/three/ will return s3_ls(".") as "one/two/three/file.txt" instead of the expected "file.txt"

pattern

character string pattern to filter results.

full.names

logical return fully qualified file names.

files.only

logical filter to show only files

dir.only

logical filter to show only directories. NOTE: Due to the fact that directories don't actually exist on S3, this won't work with recursive = T

all.files

logical show unnamed objects ("")

full.response

logical list entire metadata string from aws. Includes file modified date/time and size.

aws.args

character string of any additional values you need appended to this aws.cli command line call.

Value

character vector of bucket contents


dkrozelle/s3r documentation built on May 16, 2022, 8:36 p.m.