[plt-scheme] Process hangs with big input

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Mar 14 09:51:06 EST 2006

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



Posted on the users mailing list.