List the current files in your bucket

Description

Lists all files in the bucket or files matching a certain pattern.

Usage

aou_ls_bucket(
  pattern = "",
  silent = FALSE,
  recursive = TRUE,
  bucket = getOption("aou.default.bucket"),
  gsutil_args = ""
)

Arguments

pattern Regular expression, such as "*.csv" or a single file name e.g., "mydata.csv". Default will find all files apart from notebooks (.ipynb files).
silent Whether to omit the names of files found. Defaults to FALSE.
recursive Whether to search subdirectories. Defaults to TRUE.
bucket Bucket to retrieve file from. Defaults to getOption(“aou.default.bucket”), which is Sys.getenv(‘WORKSPACE_BUCKET’) unless specified otherwise.
gsutil_args A string containing other arguments passed to gsutil ls. See https://cloud.google.com/storage/docs/gsutil/commands/ls for details.

Value

A vector of file names

Examples

library(allofus)


# list all files, including in subdirectories
aou_ls_bucket()
# list all csv files
aou_ls_bucket("*.csv")