Skip to contents

List full file paths with the file name as the name

Usage

list.files2(path = ".", full.names = TRUE, ...)

Arguments

path

(character) dir path to files

full.names

a logical value. If TRUE, the directory path is prepended to the file names to give a relative file path. If FALSE, the file names (rather than paths) are returned.

...

Arguments passed on to base::list.files

pattern

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

all.files

a logical value. If FALSE, only the names of visible files are returned (following Unix-style visibility, that is files whose name does not start with a dot). If TRUE, all file names will be returned.

recursive

logical. Should the listing recurse into directories?

ignore.case

logical. Should pattern-matching be case-insensitive?

include.dirs

logical. Should subdirectory names be included in recursive listings? (They always are in non-recursive ones).

no..

logical. Should both "." and ".." be excluded also from non-recursive listings?

Value

(named character)

Examples

list.files2("~")
#>                factory                perflog                runners 
#> "/home/runner/factory" "/home/runner/perflog" "/home/runner/runners" 
#>                 warmup                   work 
#>  "/home/runner/warmup"    "/home/runner/work"