Re: [Rd] Problem with system2(), directing STDERR to a file

2010-11-12 Thread Dan Tenenbaum
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

Re: [Rd] Problem with system2(), directing STDERR to a file

2010-11-11 Thread Dan Tenenbaum
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"

Re: [Rd] Problem with system2(), directing STDERR to a file

2010-11-10 Thread Dan Tenenbaum
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

Re: [Rd] Problem with system2(), directing STDERR to a file

2010-11-10 Thread Keith Satterley
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

[Rd] Problem with system2(), directing STDERR to a file

2010-11-10 Thread Dan Tenenbaum
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