similar to: system2 doesn't quote stdin on unix, unlike stdout, stderr & input and on Windows

Displaying 20 results from an estimated 1000 matches similar to: "system2 doesn't quote stdin on unix, unlike stdout, stderr & input and on Windows"

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
2019 Feb 28
2
Exit status of Rscript
Current R release (3.5.2) and devel return a 0 exit status on error, while prior versions returned a non-zero exit status. On Linux and MacOs, the following line returns TRUE for R-3.5.2 and R-devel, and FALSE for R-3.5.1 and R-3.5.0: system2("Rscript", c("-e", shQuote("stop('foo')"))) == 0 I didn't find this in the NEWS, so I believe this is a bug.
2023 Oct 30
1
system()/system2() using short paths of commands on Windows?
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 investigation). Then run: system2('fmtutil-sys', '--all') # or tinytex:::fmtutil() if fmtutil-sys.exe is not on PATH
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 <-
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
2023 Oct 30
1
system()/system2() using short paths of commands on Windows?
On 10/30/23 17:18, Yihui Xie wrote: > Hi, > > It may have been so for 20+ years but I just discovered today that system() > would always try to use the short path of a command on Windows: > https://github.com/wch/r-source/blob/635a67/src/gnuwin32/run.c#L141 If > that's true, I wonder if it could provide an option to disable this > behavior, because we recently ran into a
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",
2023 Oct 30
2
system()/system2() using short paths of commands on Windows?
Hi, It may have been so for 20+ years but I just discovered today that system() would always try to use the short path of a command on Windows: https://github.com/wch/r-source/blob/635a67/src/gnuwin32/run.c#L141 If that's true, I wonder if it could provide an option to disable this behavior, because we recently ran into a case in which short paths wouldn't work. I wonder what the original
2015 May 18
4
How best to get around shadowing of executables by system()'s prepending of directories to Windows' PATH?
My question: On Windows, R's system() command prepends several directories to those in the Windows Path variable. >From ?system The search path for 'command' may be system-dependent: it will include the R 'bin' directory, the working directory and the Windows system directories before 'PATH'. This shadows any executables on the Path that share a
2023 Oct 31
1
system()/system2() using short paths of commands on Windows?
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 investigation). Then > run: > > ? system2('fmtutil-sys',
2019 Mar 14
1
r76237 broken?
It looks like the most recent SVN commit changed line 1068 of src/library/tools/R/admin.R to include a call to "shQuotee" (sic), which is now breaking Travis r-devel builds ... ('checking sizes of PDF files under ?inst/doc?: .Error in shQuotee(tf) : could not find function "shQuotee"') The new line reads: res <- system2(qpdf, c(qpdf_flags, shQuote(p),
2018 Jul 04
1
unexpected behavior of unzip with list=T and unzip=/usr/bin/unzip
Hello, I encountered some unexpected behavior of unzip when using info-zip's unzip instead of R's internal program. Specifically, unzip("file.zip", list=TRUE, unzip=/usr/bin/unzip) produces incorrect output if the zip archive has filenames with spaces, and results in an error if the zip archive includes an archive comment or file comments. Here is some code to reproduce along
2023 Oct 30
1
system()/system2() using short paths of commands on Windows?
On 30/10/2023 16:18, Yihui Xie wrote: > Hi, > > It may have been so for 20+ years but I just discovered today that system() > would always try to use the short path of a command on Windows: > https://github.com/wch/r-source/blob/635a67/src/gnuwin32/run.c#L141 If > that's true, I wonder if it could provide an option to disable this > behavior, because we recently ran into
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
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
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
2023 Oct 30
2
system()/system2() using short paths of commands on Windows?
I have read about "system() not using a shell on Windows" on the help page many times before but never understood what it means technically. Please forgive my ignorance. I still do not understand it, but thanks a lot for the explanation anyway! I'm just curious if the full path would work in system() today. If it still would not work because today's Windows is still like Windows
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
2023 Oct 31
1
system()/system2() using short paths of commands on Windows?
On 10/30/23 21:36, Yihui Xie wrote: > I have read about "system() not using a shell on Windows" on the help > page many times before but never understood what it means technically. > Please forgive my ignorance. I still do not understand it, but thanks > a lot for the explanation anyway! As the documentation says, system() on Windows runs the command directly, without a