Skip to content
Prev 385489 / 398506 Next

tempdir() does not respect TMPDIR

It is too late to set TMPDIR in .Renviron.  It is one of the
environment variables that has to be set prior to launching R.  From
help("tempfile", package = "base"):

The environment variables TMPDIR, TMP and TEMP are checked in turn and
the first found which points to a writable directory is used: if none
succeeds ?/tmp? is used. The path should not contain spaces. **Note
that setting any of these environment variables in the R session has
no effect on tempdir(): the per-session temporary directory is created
before the interpreter is started.**

/Henrik
On Sat, Aug 29, 2020 at 6:40 AM Jinsong Zhao <jszhao at yeah.net> wrote: