[plt-scheme] subprocess and wait

From: Paulo J. Matos (pocmatos at gmail.com)
Date: Sun Feb 26 10:19:18 EST 2006

On 26/02/06, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> At Sun, 26 Feb 2006 14:49:36 +0000, "Paulo J. Matos" wrote:
> > > If so, you need to read all the data from the subprocess's stdout as
> > > its running, or you need to redirect the subprocess's stdout to a port
> > > that holds arbitrary amounts of data. For example, you might call
> > > `make-pipe' (with no arguments or with #f for the `limit-k' argument),
> >
> > By doing this I get:
> > subprocess: expects type <file-stream-output-port> as 1st argument,
> > given: #<output-port:pipe>; other arguments were: #f
> > #<output-port:pipe> "/home/pmatos/solvers/...
> > "/home/pmatos/satlib/U...
>
> I forgot how the layers go.
>
> Maybe `process' from `(lib "process.ss")' will be easier to use, since
> it handles arbitrary ports.
>

Ah, great! :D Done!

Thanks a lot,

Paulo Matos

> Or create a thread to copy the subprocess stdout to a pipe while you
> wait:
>
>  (thread (lambda ()
>            (copy-port stdout-in pipe-out)
>            (close-output-port pipe-out)))
>
> Matthew
>
>


--
Paulo Jorge Matos - pocm at sat inesc-id pt
Web: http://sat.inesc-id.pt/~pocm
Computer and Software Engineering
INESC-ID - SAT Group


Posted on the users mailing list.