#38 stdin is not blocking for input on solaris9 OS

M. Saha

Expect version 5.43 and 5.44.1
Tcl version 8.4.13

Host Type/OPerating System:

[host05]-> uname -a
SunOS host05 5.9 Generic_118558-23 sun4u sparc SUNW,Netra-CP2300

When I use Expect, and try to execute the following syntax
"gets stdin"
I expect that the stdin is blocking until there is input provided by the user. However, this is not the case, the behavior of stdin is non-blocking.

e.g. See the example below where *Expect is NOT being used*, stdin is blocking (as expected) in this example.

[host05]-> tclsh
% fconfigure stdin
-blocking 1 -buffering line -buffersize 4096 -encoding iso8859-1 -eofchar {} -translation auto -mode 38400,n,8,1 -xchar { }
% gets stdin
my input here
my input here
% exit

e.g. See the example below where Expect 5.43.0 is being invoked from the Tcl Shell.

[host05]-> tclsh
% package require Expect
% fconfigure stdin
-blocking 1 -buffering line -buffersize 4096 -encoding iso8859-1 -eofchar {} -translation auto -mode 38400,n,8,1 -xchar { }
% gets stdin <====== SEE HERE,DOES NOT WAIT FOR INPUT
% exit


  • I believe my problem is the same. The most simple example I have is :
    localhost:~# (echo spawn telnet) | expect
    spawn telnet
    localhost:~# (sleep 2; echo spawn telnet) | expect

    First case, the spawn is recognised.

    Second case, no output from expect, he is already dead after 2 seconds.

  • Deeply sorry for my previous post. Using the latest cvs (which means upgrading from 5.43 to the problem disapear.

    • status: open --> pending-out-of-date
    • status: pending-out-of-date --> closed-out-of-date
  • This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).