How to check if stdin is readable in TCL?
问题 With the following command you can register some callback for stdin : fileevent stdin readable thatCallback This means that during the execution of the update command it will evaluate thatCallback time after time while there is input available at stdin . How can I check if input is available at stdin ? 回答1: You simply read/gets from stdin inside your callback. Basically the pattern goes like this snippet from the fileevent example from Kevin Kenny: proc isReadable { f } { # The channel is