dir_or_file: Collect Full Filenames from a Mix of Directories and Files
Description
The input can be one or more directories, one or more files, or the mixture of the two.
It will return the full paths of all files in a recursive way,
and sort them in increasing order. When files are put in
different areas of your disk, you may need this function to collect them.
It is essentially a wrapper of list.files.
Usage
dir_or_file(..., special = "")
Arguments
...
names of directories and files; if the input is not vector, the function will try to
coerce it. Relative paths and paths starting with "~/" are also accepted.
In Windows, both "/" and double inversed slashes inside filenames are accepted.
special
a length 1 character or regular expression. Only filenames that have this pattern
will be collected. Default value is "" (character with size 0), and is to collect everything.
Value
a character vector of full filenames with increasing order, and every name is
unique. If no filename is collected, an error will be raised.
Details
Failure may occur when obtaining absolute paths, please see normalizePath
for possible reasons.