listDirectory: Gets the file names in the directory

Description Usage Arguments Value Recursive searching Author(s) See Also

Description

Gets the file names in the directory.

Contrary to list.files(), this method guarantees to work recursively. Moreover, when subdirectories are processed recursively, directory names are also returned.

Usage

1
2
3
## Default S3 method:
listDirectory(path=".", pattern=NULL, recursive=FALSE, allNames=FALSE, fullNames=FALSE,
  ...)

Arguments

path

A path to be listed.

pattern

A character string of the filename pattern passed. See list.files() for more details.

recursive

If TRUE, subdirectories are recursively processed, and not if FALSE. Alternatively, the maximum recursive depth can be specified as a non-negative numeric, where FALSE corresponds to 0L depth and TRUE corresponds +Inf depth.

allNames

If TRUE, also files starting with a period are returned.

fullNames

If TRUE, the full path names are returned.

...

Not used.

Value

Returns a vector of file names.

Recursive searching

Recursive searching of directory structure is done breath-first in a lexicographic order.

Author(s)

Henrik Bengtsson

See Also

Internally list.files() is used.


R.utils documentation built on Sept. 26, 2021, 9:07 a.m.