Hi,
It should work. The following codes worked perfectly
while it receives inputs from the keyboard and dumps
the results.
--
Jason Sheu (�\�@��)
Quantum Effect Design Phone:408-565-0370
Suite 200 Fax: 408-565-0335
3255-3 Scott Blvd. email:[EMAIL PROTECTED]
Santa Clara, CA 95054 WWW: http://www.qedinc.com/
----------------------------------------------------------------------
proc readProgA {pid} {
global readProgADone;
# read outputs of schemdb
set tmpbuf [gets $pid];
puts "received $tmpbuf\n";
set readProgADone [eof $pid];
if {$readProgADone} {
puts "closing...";
catch [close $pid] aa;
if {$aa != ""} {
puts "HERE1: Error on closing";
exit 1;
}
}
}
# set the "read" event
fileevent stdin readable {readProgA stdin};
>
>
> Hello everyone.
>
> I am a fairly new user to Tcl, can somebody guide me out of the following
> problem.
>
> I have the following line in my code.
>
> fileevent stdin readable [list read_stdin $srvr_sock]
>
> read_stdin will then read from stdin and put the read string onto the
> socket.
>
> my problem is that the read_stdin procedure is being called even when
> nothing has been typed on the keyboard. and a gets statement in the
> procedure then blocks.
>
> This is a problem for me as i would like to monitor input from the socket
> and from the stdin simulataniously. ( i would like the read_stdin to only
> be called when something has been typed at the keyboard.
>
> A similar fileevent statement for reading from the socket works fine the
> read_sock procedure is only called when data is available for reading on
> the socket.
>
> I have configured stdin and the socket with -blocking off and -buffering
> line
>
> Thanks in advance.
>
> Naheed...........
>