[Rd] Sys.putenv environment variables disappear (PR#1371)

a215020@onyx.fmr.com a215020@onyx.fmr.com
Fri, 8 Mar 2002 22:36:49 +0100 (MET)


Environment variables set with Sys.putenv() disappear (i.e. become "")
after a while, especially after heavy-duty I/O.  Example:

  R> x <- matrix(1., 3000, 3000)
  R> save(x, file="myx.RData")
  R> Sys.putenv(HOME="/tmp")
  R> while (Sys.getenv("HOME") != "") {cat("ok\n"); load("myx.RData")}

The loop prints "ok" twice, then exits because HOME has been destroyed.

I'm running R-1.4.1 (I also saw this in earlier versions), under
Solaris 2.6.  Dave Kane reported this problem to R-help on 6/4/01, and
I reported it on 11/30/01, but nobody else has confirmed (or denied)
seeing it (except Kjetil Halvorsen did not see it on Windows).

FYI, my include/config.h file has "#define HAVE_PUTENV 1".  Here's the
usual version info.
Version:
 platform = sparc-sun-solaris2.6
 arch = sparc
 os = solaris2.6
 system = sparc, solaris2.6
 status = 
 major = 1
 minor = 4.1
 year = 2002
 month = 01
 day = 30
 language = R

Search Path:
 .GlobalEnv, package:misc, package:io, package:arrays, package:ls1, package:g.data, package:db, package:ts, package:ctest, Autoloads, package:base

                              -- David Brahm (brahm@alum.mit.edu)

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._