\Header{list.files}{List the Files in a Directory/Folder}
\alias{dir}{list.files}
\keyword{file}{list.files}
\begin{Usage}
\begin{verbatim}
list.files(path, pattern=NULL, all.files=FALSE,
    full.names=FALSE)
dir(path, pattern=NULL, all.files=FALSE,
    full.names=FALSE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\texttt{path}] a vector of full path names.
\item[\texttt{pattern}] an optional regular expression.  Only file names
which match the regular expression will be returned.
\item[\texttt{all.files}] a logical value. If \texttt{FALSE}, only the
names of visible files are returned.  If \texttt{TRUE},
all file names will be returned.
\item[\texttt{full.names}] a logical value.  If \texttt{TRUE}, the directory
path is prepended to the file names.  If \texttt{FALSE}, only
the file names are returned.
\end{ldescription}
\end{Arguments}
\begin{Description}
This function produces a list containing the names of files
in the named directory. \texttt{dir} is an alias.\end{Description}
\begin{Value}
A character vector containing the names of the files in the
specified directory, or \texttt{""} if there were no files. The files are
sorted in alphabetical order, on the full path if \begin{ldescription}
\item[\texttt{full.names = TRUE}] 
\end{ldescription}
.\end{Value}
\begin{Note}
File naming conventions are very platform dependent.

The \texttt{pattern} argument will be ignored (with a warning) when \R
is compiled without a regular expressions library.\end{Note}
\begin{Author}
Ross Ihaka\end{Author}
\begin{Examples}
\begin{ExampleCode}
list.files(R.home())
\end{ExampleCode}
\end{Examples}

