Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


flyio (version 0.1.4)

list_files: List the Files in a Directory/Folder

Description

list the files in cloud or locally - similar to list.files()

Usage

list_files(path = "", pattern = NULL, recursive = FALSE,
  ignore.case = FALSE, full.names = TRUE,
  data_source = flyio_get_datasource(),
  bucket = flyio_get_bucket(data_source), check_region = FALSE)

Arguments

path

the folder for which the files need to be listed

pattern

an optional regular expression. Only file path names that match the regular expression will be returned.

recursive

logical. Should the listing recurse into directories?

ignore.case

logical. Should pattern-matching be case-insensitive?

full.names

logical. Should the entire path be returned or only after the path inputed?

data_source

the name of the data source, gcs, s3 or local; if not set globally

bucket

the name of the bucket, if not set globally

check_region

logical. to check region for aws.s3

Value

a vector of full file names

Examples

Run this code
# NOT RUN {
# List files locally
list_files(path = tempdir(), data_source = "local")
# }
# NOT RUN {
# List files on S3
flyio_set_datasource("s3")
flyio_set_bucket("your-bucket-name")
list_files(path = "tests/", pattern = ".*csv")
# }

Run the code above in your browser using DataLab