From Kurt.Hornik@ci.tuwien.ac.at  Tue Oct 21 07:31:59 1997
From: Kurt.Hornik@ci.tuwien.ac.at (Kurt Hornik)
Date: Tue, 21 Oct 1997 08:31:59 +0200
Subject: R-alpha: system() ok  --  is.R() function
In-Reply-To: <97Oct20.130141edt.26506@mailgate.bank-banque-canada.ca>
References: <199710201331.PAA03410@sophie.ethz.ch>
 <97Oct20.130141edt.26506@mailgate.bank-banque-canada.ca>
Message-ID: <199710210631.IAA06442@pc25.none>

>>>>> Paul Gilbert writes:

> Martin
> Your revisions to my S--R compatability code suggest that tempfile() is
> in R after 0.49. I don't find that to be the case. It requires code from
> Friedrich Leisch which still has to be added as of 0.50 alpha3.

> Paul
> _______
> R : Copyright 1997, Robert Gentleman and Ross Ihaka
> Version 0.50 Alpha-3 (August 8, 1997)
>> exists("tempfile", mode = 'function')
> [1] FALSE
>>

Under Unix, you can do with the following which will also be in 0.60:

tempfile <- function(pattern = "file") {
  system(paste("for p in", paste(pattern, collapse = " "), ";",
               "do echo /tmp/$p$$; done"),
         intern = TRUE)
}


-k
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


R-alpha: system() ok -- is.R() function
Kurt Hornik