home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Practical Programming in Tcl & Tk (4th Edition)
/
TCLBOOK4.BIN
/
mac
/
exsource.old
/
16_1.tcl
< prev
next >
Wrap
Text File
|
2003-04-15
|
289b
|
21 lines
#
# Example 16-1
# A read event file handler.
#
proc Reader { pipe } {
global done
if {[eof $pipe]} {
catch {close $pipe}
set done 1
return
}
gets $pipe line
# Process the line here...
}
set pipe [open "|some command"]
fileevent $pipe readable [list Reader $pipe]
vwait done