list_files {seekr}R Documentation

List Files in Directory

Description

Lists all files from a given directory with support for recursive search and inclusion of hidden files. The function throws a specific error when no files are found, based on the combination of recurse and all parameters. Returned file paths are made unique and are assumed to be normalized using forward slashes (/).

Usage

list_files(path, recurse, all)

Arguments

path

A character vector of one or more paths.

recurse

If TRUE recurse fully, if a positive number the number of levels to recurse.

all

If TRUE hidden files are also returned.

Value

A character vector of unique file paths. If no files are found, the function aborts with a message suggesting how to adjust search parameters (recurse and all), and includes a class-specific error identifier depending on the search mode:

Examples

## Not run: 
list_files("myfolder", recurse = TRUE, all = FALSE)

## End(Not run)


[Package seekr version 0.1.3 Index]