list_files: List the Files in a Directory/Folder

Description Usage Arguments Value Examples

View source: R/list_files.R

Description

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

Usage

1
2
3
4
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

1
2
3
4
5
6
7
8
9
# 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")

## End(Not run)

flyio documentation built on Oct. 31, 2019, 4:59 p.m.