Posted to tcl by bicepjai at Wed Jun 16 02:29:10 GMT 2010view raw
- fileevent stdin readable [list data stdin]
- fconfigure stdin -blocking 0
- fconfigure stdout -buffering line
- proc data {fd} {
- if {[eof $fd]} {
- exit
- } elseif {[gets $fd line]} {
- puts "$line"
- if {$line eq "quit"} {
- exit
- } elseif {$line eq "pause"} {
- set ::counter 0
- } elseif {$line eq "resume"} {
- set ::counter 0
- }
- }
- }