\Header{tempfile}{Create Names for Temporary Files}
\keyword{file}{tempfile}
\begin{Description}\relax
Returns a vector of character strings which can be used as
names for temporary files.\end{Description}
\begin{Usage}
\begin{verbatim}
tempfile(pattern = "file")
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{pattern}] a non-empty character vector giving the initial part
of the name.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
If \code{pattern} has length greater than one then the result is of the
same length giving a temporary file name for each component of
\code{pattern}. 

The names are very likely to be unique among calls to \code{tempfile}
in an \R{} session and across simultaneous \R{} sessions.  The filenames are
guaranteed not to be currently in use.

The file name is made of the pattern, the process number in hex and a
random suffix in hex. The filenames will be in the directory given by
the first found of the environment variables \code{TMP}, \code{TEMP},
or \code{"/tmp"}.\end{Details}
\begin{Value}
A character vector giving the names of possible (temporary) files.

Note that no files are generated by \code{tempfile}.\end{Value}
\begin{SeeAlso}\relax
\code{\Link{unlink}} for deleting files.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
tempfile(c("ab", "a b c"))   # give file name with spaces in!
\end{ExampleCode}
\end{Examples}

