[plt-scheme] Process hangs with big input
At Tue, 14 Mar 2006 06:23:54 -0800 (PST), Noel Welsh wrote:
> Could there be a buffer that fills up, preventing the
> process from writing my output and terminating.
Yes. See also the thread starting here:
http://list.cs.brown.edu/pipermail/plt-scheme/2006-February/011940.html
Here's an easy solution:
(define (system/output command-string)
(let ([p (open-output-string)])
(parameterize ([current-output-port p])
(system command-string))
(get-output-string p)))
Most of the work you were doing (or would be doing to avoid deadlock)
is in `system' already.
Matthew