1mNAME0m
       puts - Write to a channel

1mSYNOPSIS0m
       1mputs 22m?1m-nonewline22m? ?4mchannelId24m? 4mstring0m


1mDESCRIPTION0m
       Writes  the  characters  given  by 4mstring24m to the channel given by 4mchan-0m
       4mnelId24m.  4mChannelId24m must be a channel identifier such as returned from  a
       previous  invocation  of  1mopen  22mor 1msocket22m. It must have been opened for
       output. If no 4mchannelId24m is specified then it defaults to  1mstdout22m.  1mPuts0m
       normally outputs a newline character after 4mstring24m, but this feature may
       be suppressed by specifying the 1m-nonewline 22mswitch.

       Newline characters in the output are translated by  1mputs  22mto  platform-
       specific  end-of-line  sequences  according to the current value of the
       1m-translation 22moption for the channel (for example, on PCs  newlines  are
       normally  replaced  with carriage-return-linefeed sequences;  on Macin-
       toshes newlines are normally replaced with carriage-returns).  See  the
       1mfconfigure  22mmanual  entry  for a discussion on ways in which 1mfconfigure0m
       will alter output.

       Tcl buffers output internally, so characters written with 1mputs 22mmay  not
       appear  immediately  on  the  output file or device;  Tcl will normally
       delay output until the buffer is full or the channel  is  closed.   You
       can force output to appear immediately with the 1mflush 22mcommand.

       When  the  output buffer fills up, the 1mputs 22mcommand will normally block
       until all the buffered data has been accepted for output by the operat-
       ing  system.  If 4mchannelId24m is in nonblocking mode then the 1mputs 22mcommand
       will not block even if the operating system  cannot  accept  the  data.
       Instead,  Tcl  continues  to buffer the data and writes it in the back-
       ground as fast as the underlying file or device  can  accept  it.   The
       application must use the Tcl event loop for nonblocking output to work;
       otherwise Tcl never finds out that the file or device is ready for more
       output data.  It is possible for an arbitrarily large amount of data to
       be buffered for a channel in nonblocking mode, which  could  consume  a
       large  amount  of  memory.   To  avoid  wasting memory, nonblocking I/O
       should normally be used in an event-driven fashion with  the  1mfileevent0m
       command (don't invoke 1mputs 22munless you have recently been notified via a
       file event that the channel is ready for more output data).


1mSEE ALSO0m
       file(n), fileevent(n)


1mKEYWORDS0m
