similar to: Problem with system2(), directing STDERR to a file

Displaying 20 results from an estimated 30000 matches similar to: "Problem with system2(), directing STDERR to a file"

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
2013 Jul 14
1
Redirect system2 stdout to a file on windows
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 full file path, but with no success: setwd(tempdir()) system2("whoami",
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:
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
2011 Oct 05
3
suppressing stderr output from system() calls
Dear list, I'm trying to suppress/redirect/squash the output from commands like install.packages, or download.file. The problem is that none of: sink(..., type="message"), sink(..., type="output"), capture.output, suppressMessages are quite doing the trick. Output gets written to the stderr stream, despite any combination of the above suppression commands. According to
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
2016 Dec 06
0
system2 fails with quiet=TRUE, but runs through with quiet=FALSE
Hi, I have recently tried to check the test coverage using library("covr") and, interestingly, the command > covr::package_coverage() fails, while > covr::package_coverage(quiet = FALSE) runs through without problem. I traced the problem to a call to utils::install.packages(), where the option quiet is passed on. In utils::install.packages(), the problem seems to lie in the
2015 Aug 08
2
download.file() on ftp URL fails in windows with default download method
----- Original Message ----- > From: "Uwe Ligges" <ligges at statistik.tu-dortmund.de> > To: "Dan Tenenbaum" <dtenenba at fredhutch.org>, "R-devel at r-project.org" <r-devel at r-project.org> > Sent: Saturday, August 8, 2015 3:57:34 PM > Subject: Re: [Rd] download.file() on ftp URL fails in windows with default download method > >
2015 Aug 12
2
download.file() on ftp URL fails in windows with default download method
We were also able to reproduce the issue on Windows Server 2012. If there's anything we can do to help please let me know; Elliot Waingold (CC'd here) can provide access to the VM we used for testing if that's of any help. # David Smith -- David M Smith <davidsmi at microsoft.com> R Community Lead, Revolution Analytics (a Microsoft company)? Tel: +1 (312) 9205766 (Chicago IL,
2015 Aug 07
3
download.file() on ftp URL fails in windows with default download method
Hi, > url <- "ftp://ftp.ncbi.nlm.nih.gov/genomes/ASSEMBLY_REPORTS/All/GCF_000001405.13.assembly.txt" > download.file(url, tempfile()) trying URL 'ftp://ftp.ncbi.nlm.nih.gov/genomes/ASSEMBLY_REPORTS/All/GCF_000001405.13.assembly.txt' Error in download.file(url, tempfile()) : cannot open URL
2002 May 12
1
minor error in "stderr & stdout" web site FAQ
Hello, There appears to be an error in the stderr redirection of the crontab rsync entry. In Bourne shell and compatibles (crontab entries are run by the Bourne shell) redirections are processed from left to right and "2>&1" redirects the stderr to the same location stdout is currently directed and not to stdout. Hence: cmd 2>&1 > log directs stderr to the
2017 Dec 14
4
cannot destroy connection (?) created by readLines in a tryCatch
On Thu, Dec 14, 2017 at 7:56 PM, Gabriel Becker <gmbecker at ucdavis.edu> wrote: > Gabor, > > You can grab the connection and destroy it via getConnection and then a > standard close call. Yeah, that's often a possible workaround, but since this connection was opened by readLines() internally, I don't necessarily know which one it is. E.g. I might open multiple
2014 Jul 16
1
Allow for passing Ctrl-C and don't mix stderr with stdout
I have been losing my mind over this problem, so any ideas are welcome. When running non-interactive jobs on remote machines, I want output to stderr and to stdout to remain separate in two streams just as if they were run locally. I also want jobs running remotely to die when I press Ctrl-C just as if they were run locally. At first glance these do not seem to be mutual exclusive, but when you
2015 Feb 01
2
Output to "raw console" rather than stdout/stderr?
In R, there's readline(), which is great because you can prompt the user, e.g. ans <- readline("Would you like to install Pandoc? [y/N]: ") without having to worry the message is intercepted by capture.output(), sink() or similar (which is used by dynamic report generators among other things). The message will always reach the user. (You can use sink(...,
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
2012 May 11
1
Replacements for stdout and stderr guaranteed to be open in all versions of R
I maintain the geometry package, which integrates the Qhull C library (http://qhull.org) into R. The Qhull function I hook into requires an open FILE handle as one of its arguments. I had set this file handle to stdout, but now R check NOTEs the presence of stdout, and the CRAN maintainers asked me to get rid of these NOTEs. Including the following defines means the checks are passed on CRAN:
2015 Sep 22
1
Differences in printing UTF-8 strings to stdout vs. stderr under Windows
It seems that under Windows, some UTF-8 strings that print OK to stdout do not print correctly to stderr. To reproduce: x <- "\ub124" cat(x, file = stdout()) ## ? cat(x, file = stderr()) ## <U+B124> Original motivating problem here: https://stackoverflow.com/questions/32696241/how-to-display-a-message-warning-error-with-unicode-characters-under-windows How does printing to
2008 Jun 19
1
Appending diagnostic information to all lines sent to stdout and stderr
Dear All I'm logging the stdout and stderr of an R program into two separate files (stderr.txt and stdout.txt) using sink() I would like to append extra information such as "date", "memory usage" etc to every line of output that goes to stdout or stderr. For example > cat("hello \n") should give output that looks something like: "hello --- Thu Jun 19
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