Rev 6098 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{list.files}\alias{list.files}\alias{dir}\title{List the Files in a Directory/Folder}\usage{list.files(path, pattern=NULL, all.files=FALSE,full.names=FALSE)dir(path, pattern=NULL, all.files=FALSE,full.names=FALSE)}\arguments{\item{path}{a vector of full path names.}\item{pattern}{an optional regular expression. Only file nameswhich match the regular expression will be returned.}\item{all.files}{a logical value. If \code{FALSE}, only thenames of visible files are returned. If \code{TRUE},all file names will be returned.}\item{full.names}{a logical value. If \code{TRUE}, the directorypath is prepended to the file names. If \code{FALSE}, onlythe file names are returned.}}\description{This function produces a list containing the names of filesin the named directory. \code{dir} is an alias.}\value{A character vector containing the names of the files in thespecified directory, or \code{""} if there were no files. The files aresorted in alphabetical order, on the full path if \code{full.names = TRUE}.}\author{Ross Ihaka}\note{File naming conventions are very platform dependent.The \code{pattern} argument will be ignored (with a warning) when \Ris compiled without a regular expressions library.}\examples{list.files(R.home())}\keyword{file}