Rev 9936 | Rev 23729 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{tempfile}\alias{tempfile}\title{Create Names for Temporary Files}\description{Returns a vector of character strings which can be used asnames for temporary files.}\usage{tempfile(pattern = "file")}\arguments{\item{pattern}{a non-empty character vector giving the initial partof the name.}}\value{A character vector giving the names of possible (temporary) files.Note that no files are generated by \code{tempfile}.}\details{If \code{pattern} has length greater than one then the result is of thesame 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 areguaranteed not to be currently in use.#ifdef unixThe file name is made of the pattern, the process number in hex and arandom suffix in hex. The filenames will be in the directory given bythe first found of the environment variables \code{TMP}, \code{TEMP},or \code{"/tmp"}.#endif#ifdef windowsThe filenames will be in the directory given by the first found ofthe environment variables \code{TMP}, \code{TEMP} and \code{R\_USER}(see \code{\link{Rconsole}}). If the path to the directory containsa space in any of the components, the path returned will use theshortnames version of the path.#endif}\seealso{\code{\link{unlink}} for deleting files.}#ifdef unix\examples{tempfile(c("ab", "a b c")) # give file name with spaces in!}#endif\keyword{file}