1flush(n) Tcl Built-In Commands flush(n)
2
3
4
5______________________________________________________________________________
6
8 flush - Flush buffered output for a channel
9
11 flush channelId
12_________________________________________________________________
13
14
16 Flushes any output that has been buffered for channelId.
17
18 ChannelId must be an identifier for an open channel such as a Tcl stan‐
19 dard channel (stdout or stderr), the return value from an invocation of
20 open or socket, or the result of a channel creation command provided by
21 a Tcl extension. The channel must have been opened for writing.
22
23 If the channel is in blocking mode the command does not return until
24 all the buffered output has been flushed to the channel. If the channel
25 is in nonblocking mode, the command may return before all buffered out‐
26 put has been flushed; the remainder will be flushed in the background
27 as fast as the underlying file or device is able to absorb it.
28
30 Prompt for the user to type some information in on the console:
31 puts -nonewline "Please type your name: "
32 flush stdout
33 gets stdin name
34 puts "Hello there, $name!"
35
36
38 file(n), open(n), socket(n), Tcl_StandardChannels(3)
39
40
42 blocking, buffer, channel, flush, nonblocking, output
43
44
45
46Tcl 7.5 flush(n)