[plt-scheme] Trouble with IO ports

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sun Feb 8 16:47:01 EST 2009

On Sun, Feb 8, 2009 at 3:39 PM, Michel S. <michel.sylvan at gmail.com> wrote:
> Using PLT 4.1.4 (the Fedora 9/i386 from plt-scheme.org), when creating
> a process, the input port appears to never contain anything.
>
> Example:
>
> (require scheme/system)
>> (require scheme/system)
>> (define p (process "bash"))
>> (define ip (car p))
>> (define op (cadr p))
>> (char-ready? ip)
> #f
>> (fprintf (cadr p) "ls /")
>> (flush-output)
>> (char-ready? ip)
> #f

I think you just miss the newline. At least that works on my mac, as below.

Robby

> (require scheme/system)
> (define p (process "bash"))
> (define ip (car p))
> (define op (cadr p))>
#<procedure:>>
> > (fprintf (cadr p) "ls /\n")
> (thread (lambda () (copy-port ip (current-output-port))))
#<thread>
> (flush-output (cadr p))
Applications
... the contents of my / directory follow ...


Posted on the users mailing list.