[plt-scheme] writing to subprocess's stdin and then...

From: YC (yinso.chen at gmail.com)
Date: Tue Jun 17 01:27:23 EDT 2008

Hi -
I am trying to write to a subprocess's stdin (and then to read from its
stdout) without much success.  I roughly have the form of

  (let-values (((p pout pin perr)
                (subprocess #f #f #f cmd)))
    (write "this is a text" pin)
    (subprocess-wait p)
    (parameterize ((current-input-port pout))
      (lambda ()
        (read-line))))

but it doesn't work and I suspect it's due to my misunderstanding of how the
port works (and most likely just how to use subprocess, period).  The v4
maually mentions "All provided ports must be file-stream ports" - so does
that mean I need to first write the output to a file?  I found an example on
http://www.cs.brown.edu/pipermail/plt-scheme/2006-February/011953.html but
couldn't figure out how to adopt it toward my needs.

Any pointers are appreciated, thanks.
yc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20080616/1871c1fb/attachment.html>

Posted on the users mailing list.