similar to: Redirect system2 stdout to a file on windows

Displaying 20 results from an estimated 7000 matches similar to: "Redirect system2 stdout to a file on windows"

2019 Dec 15
1
system2 doesn't quote stdin on unix, unlike stdout, stderr & input and on Windows
Hi again! While investigating the bug report [*] I found out that on unix, system2 does not quote its `stdin` argument while preparing the command line to launch. It does shQuote the `stdout` and `stderr` arguments, and also the `f <- tmpfile()` variable (which is used if `input` argument is provided), which seems to set a precedent. On Windows, stdin, stdout, and stderr are handled
2013 Sep 23
1
Capture output of install.packages (pipe system2)
Is there any way to capture output (both stdout and stderr) from install.packages? Solutions like sink and capture.output don't work because the install.packages calls out to system2 which is executed in a separate process: test <- capture.output(install.packages("MASS")) The system2 function does have arguments stdout and stderr but afaik these cannot be controlled via
2020 Mar 23
2
Inconsistant result for normalizePath on Windows
Hi all, I saw a quite surprising result in the devel R when using the function *normalizePath*. If the input is a path to a folder, the function returns an absolute path with/without a slash at the end depending on the existence of the folder. I know both results are valid on Windows but this behavior is different than R3.6, I do not know if the change in the devel version is made on purpose.
2014 Sep 07
2
normalizePath is sometimes very slow for nonexistent UNC paths
I'm having an issue with occasionally slow-running calls to normalizePath. If the path is a non-existent UNC path, then normalizePath sometimes takes 6 or 7 seconds to run, rather than its usual few microseconds. My big problem is that I can't reliably reproduce this across machines. The example below generates one or two slow runs out of 10000 on my Windows machine. I haven't been
2018 Jan 26
2
utils::install.packages with quiet=TRUE fails for source packages on Windows
Hi, Installing a source package on Windows using utils::install.packages() with quiet=TRUE fails, while it works with the default quiet = FALSE. The problem seems to be caused by the fact that when quiet = TRUE, stdout and stderr are set to FALSE when calling "R CMD INSTALL" with base::system2() here:
2010 Nov 11
1
Problem with system2(), directing STDERR to a file
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 "stderr" And the following R code: > t <- tempfile() > res <-
2018 Jan 26
1
utils::install.packages with quiet=TRUE fails for source packages on Windows
The obvious guess would be that Rstudio is attempting something like redirecting output and getting itself confused. However, it is pretty clearly Their Problem, no? Rstudio has their own support infrastructure. -pd > On 26 Jan 2018, at 09:17 , Andreas Kersting <r-devel at akersting.de> wrote: > > Just noticed that this problem only occurs from within RStudio (v1.1.414). Any
2019 Dec 13
1
tempdir() containing spaces breaks installing source packages
Hello everyone! Temp paths are used in system2() calls without shQuote() because they are assumed not to contain spaces. On Windows, GetShortPathName() is used to try to ensure that. Unfortunately, sometimes GetShortPathName() silently fails to return a 8.3 file path and gives a full path instead (8.3 file names might be disabled on newer Windows 10 installations, or there may be another
2019 Mar 19
2
Possibly broken system2 env-option
On Tue, Mar 19, 2019 at 9:59 AM peter dalgaard <pdalgd at gmail.com> wrote: [...] > What you need is something like (NB: single quotes!) > > system2("sh", env = c("VAR='Hello World'"), args = c("-c 'echo $VAR'")) > Hello World Just out of curiosity, do you think it is possible to make this portable, assuming sh is available? On
2017 May 17
3
problem running test on a system without /etc/localtime
Hi all, A problem with tests while building R. I'm packaging R for Sisyphus repository and package build environment, by design, doesn't have /etc/localtime file present. This causes failure with Sys.timeone during test run: [builder at localhost tests]$ ../bin/R --vanilla < reg-tests-1d.R > ## PR#17186 - Sys.timezone() on some Debian-derived platforms > (S.t <-
2015 Mar 11
1
normalizePath output depends on existence of directory
Dear all, I'm not sure whether this is intended behaviour or a bug. The path returns from normalizePath is different when the directory doesn't exist. I have included a reproducible example. path <- tempfile() missing.dir <- normalizePath(path, winslash = "/", mustWork = FALSE) dir.create(path) existing.dir <- normalizePath(path, winslash = "/", mustWork =
2019 Mar 18
4
Possibly broken system2 env-option
Hey all, what is wrong with this command: system2("echo", env = c(VAR = "Hello World"), args = c("$VAR")) I am a bit confused, as help("system2") writes about the env option: > character vector of name=value strings to set environment variables. Is this option buggy, or am I using it just wrong? Thanks for your help Henning
2018 Sep 14
2
Bug when calling system/system2 (and request for Bugzilla account)
I hope it's not too specific in my setup... I've tried with system2 added on the first line, so: Example.R: system2('ls', timeout=5) cat('Start non-interruptable functions\n') sample_a <- sample(1:1e7) sample_b <- sample(1:2e7) matching <- match(sample_a, sample_b) cat('Finished\n') Sys.sleep(10) And in terminal/bash: R --vanilla
2018 Sep 14
3
Bug when calling system/system2 (and request for Bugzilla account)
Hi all, I found some strange behaviour, which I think is a bug. Could someone make an account for me on Bugzilla or pass on my report? The problem: When pressing Ctrl-C when a file is sourced in R, run from Terminal (macOS), sometimes the entire session is ended right away, while I just want to stop the script. This is the case when I press Ctrl-C while some functions are running that don?t
2010 Nov 02
1
system() and system2() functions
Hello, I help to maintain a moderate library of R code. In this code we have a number of calls to the system function along the lines of: exe_output = system("./executable.exe",intern=T) We tend to prefer system() over shell() because, provided the executable has been compiled and the working directory set, the command works under both linux and windows. We've never had a
2017 Apr 18
2
system/system2 and open file descriptors
It seems that the system() and system2() functions don't close file descriptors between the fork() and exec() (on Unix platforms, of course). This means that the child processes inherit open files and socket connections. Running this (from a terminal) will result in the child process writing to a file that was opened by R: R f <- file('foo.txt', 'w') system('echo
2017 May 17
1
problem running test on a system without /etc/localtime
>>>>> Henrik Bengtsson <henrik.bengtsson at gmail.com> >>>>> on Tue, 16 May 2017 20:49:02 -0700 writes: > On Tue, May 16, 2017 at 5:35 PM, Kirill Maslinsky <kirill at altlinux.org> wrote: >> Hi all, >> >> A problem with tests while building R. >> >> I'm packaging R for Sisyphus repository
2023 Feb 27
1
Undocumented change of dirname("C:/") on R-devel on Windows
Hi Tomas, There has been an R CMD check error with xfun and r-devel on Windows for a while: https://www.r-project.org/nosvn/R.check/r-devel-windows-x86_64/xfun-00check.html Basically it means that the following would return TRUE before: normalizePath('a/b', mustWork = FALSE) == normalizePath('./a/b', mustWork = FALSE) but it became FALSE at some point in r-devel. I think
2013 Apr 27
3
path reference problems in R 3.0.0
Hi- I just upgraded R to 3.0.0 from 2.15.1 (which worked fine). When I started trying to install updated versions of the libraries, I saw the following error: > install.packages("lme4") Installing package into 'c:/Docume~1/melissa/R/win-library/3.0' (as 'lib' is unspecified) Warning in install.packages :
2023 Oct 31
1
system()/system2() using short paths of commands on Windows?
On 31/10/2023 4:32 a.m., Tomas Kalibera wrote: > > On 10/30/23 19:07, Yihui Xie wrote: >> Sure. I'm not sure if it's possible to make it easier to reproduce, >> but for now the example would require installing TinyTeX (via >> tinytex::install_tinytex(), which can be later uninstalled cleanly via >> tinytex::uninstall_tinytex() after you finish the