Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stdout and stderr not captured from spawned process #68

Open
quantsch opened this issue Mar 2, 2020 · 1 comment
Open

Stdout and stderr not captured from spawned process #68

quantsch opened this issue Mar 2, 2020 · 1 comment

Comments

@quantsch
Copy link

quantsch commented Mar 2, 2020

Problem

stdout not captured in process_read. Also stderr is not captured, if you adjust the example code to non-zero exit, e.g. handle <- spawn_process("/bin/ls -$") . In my opinion, this should capture in stderr:

ls: invalid option -- '$'
Try 'ls --help' for more information.

This was apparently introduced in version 0.8.3, as the same code with 0.8.2 works just fine.

Reproduction

# setwd("path/to/dir/with/files")
library(subprocess)
handle <- spawn_process("/bin/ls") 
process_read(handle)

sessionInfo

R version 3.4.4 (2018-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.4 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=de_CH.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=de_CH.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=de_CH.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=de_CH.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] subprocess_0.8.3

loaded via a namespace (and not attached):
[1] compiler_3.4.4 tools_3.4.4 

Thanks for having a look!

@lbartnik
Copy link
Owner

lbartnik commented Mar 3, 2020

Hi, thanks for reporting the problem. subprocess is now retired (archived on CRAN). I suggest using the processx package which is in active development and offers a much more thorough functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants