Thanks for the windows fix.
There seems to be a new problem on unix.
I added a line in system2() to print out what "command" is before
.Internal(system(command, intern))
is called:
dhcp151078:R-latest dtenenba$ svn diff
src/library/base/R/unix/system.unix.R
Index: src/library/base/R/unix/system
I notice that a fix for this issue was checked in. Thanks, much appreciated!
But it still seems broken on Windows. Given the same ruby script, and this R
code:
> cmd <- "c:/ruby192/bin/ruby"
> args <- c("test.rb")
> t <- tempfile()
> system2(cmd, args, stdout=TRUE, stderr=t)
[1] "stderr" "stdout"
Hi Keith,
The problem is not with tempfile(), and is not really a problem of whether a
file exists or not. The problem is that system2() does not put the contents
of stderr into the file. Here is a demonstration without the use of
tempfile(), using a pre-existing output file:
klediment:~ dante$ e
Looking at help for tempfile,
"tempfile" returns a vector of character strings which can be used as
names for temporary files.
and
For "tempfile" a character vector giving the names of possible
(temporary) files. Note that no files are generated by "tempfile".
try a file.create(t) after
According to ?system2, I should be able to direct the output of STDERR to a
file by giving the filename as a character vector to the "stderr" argument.
But here is what happens.
Given a ruby script test.rb (with its executable bit set):
#!/usr/bin/env ruby
STDOUT.puts "stdout"
STDERR.puts "stder