\HeaderA{file\_test}{Shell-style Tests on Files}{file.Rul.test}
\keyword{file}{file\_test}
\begin{Description}\relax
Utility for testing files.
\end{Description}
\begin{Usage}
\begin{verbatim}
file_test(op, x, y)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{op}] a character string specifying the test to be performed.
Unary tests (only \code{x} is used) are \code{"-f"} (existence and
not being a directory) and \code{"-d"} (existence and directory);
binary tests are \code{"-nt"} (newer than, using the modification
dates) and \code{"-ot"}.
\item[\code{x,y}] character vectors giving file paths.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\code{file\_test} performs shell-style file tests.

Note that \code{\LinkA{file.exists}{file.exists}} only tests for existence
(\code{test -e} on some systems) but not for not being a directory.
\end{Details}
\begin{SeeAlso}\relax
\code{\LinkA{file.path}{file.path}},
\code{\LinkA{file.info}{file.info}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
dir <- file.path(R.home(), "library", "stats")
file_test("-d", dir)
file_test("-nt", file.path(dir, "R"), file.path(dir, "demo"))
\end{ExampleCode}
\end{Examples}

