> -----Original Message-----
> From: r-help-boun...@r-project.org 
> [mailto:r-help-boun...@r-project.org] On Behalf Of Duncan Murdoch
> Sent: Friday, September 04, 2009 5:05 PM
> To: Gábor Csárdi
> Cc: R mailing list
> Subject: Re: [R] Running R on read-only file system,without 
> temporary directory
> 
> On 04/09/2009 3:42 PM, Gábor Csárdi wrote:
> > Dear All,
> > 
> > I would like to do run R without having write permissions to any
> > directory on the system. It seems that I need to modify the R source
> > code for this, to make R start without creating a temporary 
> directory.
> > 
> > So far, so good. But should I expect any more complications? Does R
> > really need the temporary directory that much?
> 
> Many R functions create temporary files in it.  (There are around 20 
> calls to tempfile() and another 20 to tempdir() in the base R 
> sources, 
> if my quick grep was right.  I've no idea how many calls 
> there are from 
> contributed packages.)  Would R work if these all failed?  I 
> don't know, 
> but I'd guess it wouldn't work very well.
> 
> Duncan Murdoch

On Linux R can do quite a bit without using R_SESSION_TMPDIR
(which is where its temp files get made).  You can see if it can
do enough for your needs by doing
   Sys.chmod(Sys.getenv("R_SESSION_TMPDIR"), "0000")
right after starting up.  E.g.,

   > Sys.chmod(Sys.getenv("R_SESSION_TMPDIR"), "0000")
   > 1:10
    [1]  1  2  3  4  5  6  7  8  9 10
   > names(cars)
   [1] "speed" "dist"
   > lm(dist~speed, data=cars)

  Call: 
  lm(formula = dist ~ speed, data = cars)

  Coefficients:
  (Intercept)        speed
      -17.579        3.932

  > plot(.Last.value)
  Hit <Return> to see next plot:
  Hit <Return> to see next plot:
  Hit <Return> to see next plot:
  Hit <Return> to see next plot:
  > help(plot)
  Error in file(out, "wt") : cannot open the connection
  In addition: Warning message:
  In file(out, "wt") :
    cannot open file '/tmp/RtmpPxKrY4/Rtxt327b23c6': Permission denied
  > example(lm)
  Error in file(out, "wt") : cannot open the connection
  In addition: Warning message:
  In file(out, "wt") :
    cannot open file '/tmp/RtmpPxKrY4/Rex643c9869': Permission denied
  > install.packages("ggplot2")
  --- Please select a CRAN mirror for use in this session ---
  Loading Tcl/Tk interface ... done
  Error in install.packages("ggplot2") :
    unable to create temporary directory '/tmp/RtmpPxKrY4/downloaded_packages'
  In addition: Warning message:
  In dir.create(tmpd) :
    cannot create dir '/tmp/RtmpPxKrY4/downloaded_packages', reason 'Permission 
denied'

Of couse, that doesn't catch things done during startup or temp files
created outside of the R-standard directory.

Bill Dunlap
TIBCO Software Inc - Spotfire Division
wdunlap tibco.com  

> 
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to