[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pipe buffering
From: |
Neil Jerram |
Subject: |
Re: pipe buffering |
Date: |
Sat, 25 Sep 2010 00:30:08 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Aidan Gauland <address@hidden> writes:
> Maybe it would be better to post my original program that would just
> hang. I was only using expect to print debugging messages; my
> original program used expect-strings.
>
> --Aidan
>
> #! /usr/bin/guile -s
> !#
>
> (use-modules (ice-9 expect))
> (use-modules (ice-9 popen))
>
> (define ie-io (open-pipe* OPEN_BOTH
> "/usr/bin/telnet"
> "ienabler.canterbury.ac.nz" "259"))
> (let ((expect-port ie-io))
> (expect-strings
> ("^User:" (begin (display "[snip]\n" ie-io) (display "gave user")))
> ("^passwd:" (begin (display "[snip]\n" ie-io) (display "gave passwd")))))
Ah, thanks.
I'm afraid I think you're stuck. The problem sounds like this one:
http://stackoverflow.com/questions/1000674/turn-off-buffering-in-pipe.
In which case, the only fix is to set up the "pipe" as a pseudo-terminal
instead, and I don't believe Guile can do that.
If you wanted to work on a patch, a possible starting point would be to
look at how Emacs implements
(let ((process-connection-type t))
(open-network-stream ...))
Regards,
Neil