files.in.dir(dir)
dir
, including subdirectories but excluding
the special names "." and ".."
(this directory and the parent directory, respectively).
The names are sorted.
On Unix systems output is the same as
unix(paste("ls -A", dir))
On Windows the output is the sorted output of
dos(paste("dir /a /b", dir))
The new functions
list.files()
and
dir()
are similar to
files.in.dir()
but have options for greater functionality: recursive listings, full path names,
pattern matching of file names, and limiting returned list
to either directories or files.
is.element(".Data", files.in.dir(".")) # Should give the same result as file.exists("./.Data") # except that file.exists can give some more details when the file # does not exist.