Skip to content

Stdout and stderr not captured from spawned process #68

@quantsch

Description

@quantsch

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions