| 1 | '\" |
|---|
| 2 | '\" Copyright (c) 1993 The Regents of the University of California. |
|---|
| 3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. |
|---|
| 4 | '\" |
|---|
| 5 | '\" See the file "license.terms" for information on usage and redistribution |
|---|
| 6 | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
|---|
| 7 | '\" |
|---|
| 8 | '\" RCS: @(#) $Id: flush.n,v 1.8 2005/05/10 18:34:00 kennykb Exp $ |
|---|
| 9 | '\" |
|---|
| 10 | .so man.macros |
|---|
| 11 | .TH flush n 7.5 Tcl "Tcl Built-In Commands" |
|---|
| 12 | .BS |
|---|
| 13 | '\" Note: do not modify the .SH NAME line immediately below! |
|---|
| 14 | .SH NAME |
|---|
| 15 | flush \- Flush buffered output for a channel |
|---|
| 16 | .SH SYNOPSIS |
|---|
| 17 | \fBflush \fIchannelId\fR |
|---|
| 18 | .BE |
|---|
| 19 | |
|---|
| 20 | .SH DESCRIPTION |
|---|
| 21 | .PP |
|---|
| 22 | Flushes any output that has been buffered for \fIchannelId\fR. |
|---|
| 23 | .PP |
|---|
| 24 | \fIChannelId\fR must be an identifier for an open channel such as a |
|---|
| 25 | Tcl standard channel (\fBstdout\fR or \fBstderr\fR), the return |
|---|
| 26 | value from an invocation of \fBopen\fR or \fBsocket\fR, or the result |
|---|
| 27 | of a channel creation command provided by a Tcl extension. The |
|---|
| 28 | channel must have been opened for writing. |
|---|
| 29 | .PP |
|---|
| 30 | If the channel is in blocking mode the command does not return until all the |
|---|
| 31 | buffered output has been flushed to the channel. If the channel is in |
|---|
| 32 | nonblocking mode, the command may return before all buffered output has been |
|---|
| 33 | flushed; the remainder will be flushed in the background as fast as the |
|---|
| 34 | underlying file or device is able to absorb it. |
|---|
| 35 | .SH EXAMPLE |
|---|
| 36 | Prompt for the user to type some information in on the console: |
|---|
| 37 | .CS |
|---|
| 38 | puts -nonewline "Please type your name: " |
|---|
| 39 | \fBflush\fR stdout |
|---|
| 40 | gets stdin name |
|---|
| 41 | puts "Hello there, $name!" |
|---|
| 42 | .CE |
|---|
| 43 | |
|---|
| 44 | .SH "SEE ALSO" |
|---|
| 45 | file(n), open(n), socket(n), Tcl_StandardChannels(3) |
|---|
| 46 | |
|---|
| 47 | .SH KEYWORDS |
|---|
| 48 | blocking, buffer, channel, flush, nonblocking, output |
|---|