Files in a Directory

DESCRIPTION:

List the names of files in a directory.

USAGE:

files.in.dir(dir)

REQUIRED ARGUMENTS:

dir
a character string containing the name of a directory.

VALUE:

the names of all files in dir, including subdirectories but excluding the special names "." and ".." (this directory and the parent directory, respectively). The names are sorted.

DETAILS:

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.

SEE ALSO:

(and dir), , , , , , , .

EXAMPLES:

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.