Re: [Rd] Redirect system2 stdout to a file on windows

2013-07-14 Thread Henrik Bengtsson
Works for me (Win 7 64bit) using R.exe: > setwd(tempdir()) > getwd() [1] "C:/Users/hb/AppData/Local/Temp/RtmpSqjCDt" > res <- system2("whoami", stdout="out.txt", stderr="err.txt") > res [1] 0 > file.info(c("out.txt", "err.txt")) size isdir mode mtime ctime out.t

Re: [Rd] Redirect system2 stdout to a file on windows

2013-07-14 Thread Gabor Grothendieck
On Sun, Jul 14, 2013 at 5:20 PM, Jeroen Ooms wrote: > On Sun, Jul 14, 2013 at 10:24 PM, Gabor Grothendieck wrote: >> Try: >> out.txt <- normalizePath("./out.txt", mustWork = FALSE) > > Doesn't work either, neither on Win7 nor WinXP. > >> sessionInfo() > R version 3.0.1 (2013-05-16) > Platform: x86

Re: [Rd] Redirect system2 stdout to a file on windows

2013-07-14 Thread Jeroen Ooms
On Sun, Jul 14, 2013 at 10:24 PM, Gabor Grothendieck wrote: > Try: > out.txt <- normalizePath("./out.txt", mustWork = FALSE) Doesn't work either, neither on Win7 nor WinXP. > sessionInfo() R version 3.0.1 (2013-05-16) Platform: x86_64-w64-mingw32/x64 (64-bit)

Re: [Rd] Redirect system2 stdout to a file on windows

2013-07-14 Thread Gabor Grothendieck
On Sun, Jul 14, 2013 at 1:18 PM, Jeroen Ooms wrote: > According to the manual, the `stdout` argument of the `system2` > function can redirect output to a file. This seems to work on unix, > however I can't get it to work on windows. The toy example below, no > `out.txt` or `err.txt` files are crea

[Rd] Redirect system2 stdout to a file on windows

2013-07-14 Thread Jeroen Ooms
According to the manual, the `stdout` argument of the `system2` function can redirect output to a file. This seems to work on unix, however I can't get it to work on windows. The toy example below, no `out.txt` or `err.txt` files are created. I tried sending it to an existing file, or expand the fu