Description Usage Arguments Details Value Note Author(s) Examples
set.tempdir changes the directury returned by
tempdir(). It should only be used after forking
(in particular when switching users) so that multiple processes don't
share the temporary directory.
1 | set.tempdir(path)
|
path |
string, path to use as the temporary directory |
Normally tempdir() is created and initialized on R startup and
should not be changed. However, when using fork() the child
process inherits the same directory which may not be desirable, in
particular when the child wants to use set.user to
change the owner. In such cases set.tempdir can be used to
change the temporary directory that R will be using.
path will be passed to path.expand first.
The newly set path
set.tempdir does not check that the path is valid and/or
writable. it is th eusere's responsibility to create teh path and then
use set.tempdir, otherwise R may not function properly.
Simon Urbanek
1 2 3 4 5 6 | ## Not run:
## create process-specific tempdir
dir.create(t <- paste(tempdir(), Sys.getpid(), sep='-'), FALSE, TRUE, "0700")
set.tempdir(t)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.