Posted to tcl by Bradipo at Fri Sep 17 23:04:13 GMT 2010view raw
- % proc process {fd} {
- if {![eof $fd]} {
- puts stderr "not eof"
- gets $fd data
- return
- }
- set ::done 1
- close $fd
- puts stderr "all done"
- }
- % set fd [open "|/bin/sleep 300" w+]
- file5
- % fileevent $fd readable [list process $fd]
- % vwait done
- not eof
- % close $fd
- can not find channel named "file5"