listDirectory
From R.utils v2.0.0
by Henrik Bengtsson
Gets the file names in the directory
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.
- Keywords
- programming, IO
Usage
## S3 method for class 'default':
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. Seelist.files
() for more details. - recursive
- If
TRUE
, subdirectories are recursively processed, and not ifFALSE
. Alternatively, the maximum recursive depth can be specified as - 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.
See Also
Internally list.files
() is used.
Community examples
Looks like there are no examples yet.