[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pipe buffering
From: |
Aidan Gauland |
Subject: |
Re: pipe buffering |
Date: |
Thu, 23 Sep 2010 08:50:59 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Neil Jerram <neil <at> ossau.uklinux.net> writes:
> Well, as the manual says:
>
> -- Macro: expect clause ...
> [...] The procedures
> are called in turn after each character is read from the port,
> [...]
>
> The test is successful if the procedure returns a non-false value.
>
> Your lambda returns *unspecified*, which counts as a non-false value.
> So the whole (expect ...) invocation completes after reading just one
> character.
I must've missed that "each character" bit.
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")))))