1<HTML><HEAD><TITLE>Tcl Built-In Commands - flush manual page</TITLE></HEAD><BODY>
2<H3><A NAME="M2">NAME</A></H3>
3flush - Flush buffered output for a channel
4<H3><A NAME="M3">SYNOPSIS</A></H3>
5<B>flush </B><I>channelId</I><BR>
6<H3><A NAME="M4">DESCRIPTION</A></H3>
7Flushes any output that has been buffered for <I>channelId</I>.
8<P>
9<I>ChannelId</I> must be an identifier for an open channel such as a
10Tcl standard channel (<B>stdout</B> or <B>stderr</B>), the return
11value from an invocation of <B><A HREF="../TclCmd/open.htm">open</A></B> or <B><A HREF="../TclCmd/socket.htm">socket</A></B>, or the result
12of a channel creation command provided by a Tcl extension.  The
13channel must have been opened for writing.
14<P>
15If the channel is in blocking mode the command does not return until all the
16buffered output has been flushed to the channel. If the channel is in
17nonblocking mode, the command may return before all buffered output has been
18flushed; the remainder will be flushed in the background as fast as the
19underlying file or device is able to absorb it.
20<H3><A NAME="M5">EXAMPLE</A></H3>
21Prompt for the user to type some information in on the console:
22<PRE>puts -nonewline &quot;Please type your name: &quot;
23<B>flush</B> stdout
24gets stdin name
25puts &quot;Hello there, $name!&quot;</PRE>
26<H3><A NAME="M6">SEE ALSO</A></H3>
27<B><A HREF="../TclCmd/file.htm">file</A></B>, <B><A HREF="../TclCmd/open.htm">open</A></B>, <B><A HREF="../TclCmd/socket.htm">socket</A></B>, <B><A HREF="../TclLib/StdChannels.htm">Tcl_StandardChannels</A></B>
28<H3><A NAME="M7">KEYWORDS</A></H3>
29<A href="../Keywords/B.htm#blocking">blocking</A>, <A href="../Keywords/B.htm#buffer">buffer</A>, <A href="../Keywords/C.htm#channel">channel</A>, <A href="../Keywords/F.htm#flush">flush</A>, <A href="../Keywords/N.htm#nonblocking">nonblocking</A>, <A href="../Keywords/O.htm#output">output</A>
30<HR><PRE>
31<A HREF="../copyright.htm">Copyright</A> &#169; 1993 The Regents of the University of California.
32<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
33<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
34</BODY></HTML>
35