Well, if you want blocking, you can poll with an infinite timeout.
This returns if
1) there is output,
2) the process terminates, or
3) you interrupt with CTRL+C / ESC /etc.

and then right after the polling, you can read the output. This still
works if the process has finished already.

Gabor

On Mon, Mar 16, 2020 at 7:06 PM Greg Minshall <minsh...@umich.edu> wrote:
>
> Gabor, thanks.  yes, managing the two-way communication is always a bit
> error-prone, as it depends on the input/output characteristics of the
> two ends -- they either match, or deadlock.  it's too bad if polling is
> always *required* -- i'd think sometimes a programmer would be happy
> blocking, though other times one wants better control over when to
> block.  cheers, Greg

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to