\Header{unlink}{Delete Files and Directories}
\keyword{file}{unlink}
\begin{Description}\relax
\code{unlink} deletes the file(s) or directories specified by \code{x}.\end{Description}
\begin{Usage}
\begin{verbatim}unlink(x, recursive = FALSE)\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] a character vector with the names of the file(s) or
directories to be deleted.
Wildcards (normally \file{*} and \file{?}) are allowed.
\item[\code{recursive}] logical. Should directories be deleted
recusively?
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
If \code{recusive = FALSE} directories are not deleted,
not even empty ones.

\code{\Link{file.remove}} can only remove files, but gives more
detailed error information.\end{Details}
\begin{Value}
The return value of the corresponding system command, \code{rm -f},
normally \code{0} for success, \code{1} for failure.
Not deleting a non-existent file is not a failure.\end{Value}
\begin{Note}\relax
Prior to \R{} version 1.2.0 the default on Unix was \code{recursive =
    TRUE}, and on Windows empty directories could be deleted.\end{Note}
\begin{SeeAlso}\relax
\code{\Link{file.remove}}.\end{SeeAlso}

