NAME
       fconfigure - Set and get options on a channel

SYNOPSIS
       fconfigure channelId
       fconfigure channelId name
       fconfigure channelId name value ?name value ...?


DESCRIPTION
       The  fconfigure  command  sets  and  retrieves options for
       channels.  ChannelId identifies the channel for  which  to
       set or query an option.  If no name or value arguments are
       supplied, the command returns a list containing all of the
       option names and values for the channel; each pair of ele-
       ments in the list consists of the name and value  for  one
       option.  If name is supplied but no value then the command
       returns the value of the given option.   If  one  or  more
       pairs  of  name  and  value are supplied, the command sets
       each of the named options to the corresponding  value;  in
       this case the return value is an empty string.

       The following options and values are currently supported:

       -blocking boolean
              The  -blocking option determines whether I/O opera-
              tions on the channel can cause the process to block
              indefinitely.   The  value  of the option must be a
              proper boolean value.   Channels  are  normally  in
              blocking  mode;   if  a channel is placed into non-
              blocking mode it will affect the operation  of  the
              gets,  read,  puts,  flush, and close commands; see
              the documentation for those commands  for  details.
              Setting  stdin,  stdout, or stderr into nonblocking
              mode is disallowed because it could interfere  with
              the operation of the parent process.  For nonblock-
              ing mode to work correctly, the application must be
              using   the   Tcl   event  loop  (e.g.  by  calling
              Tcl_DoOneEvent or invoking the vwait command).

       -linemode boolean
              If boolean is a true value then the I/O system will
              automatically flush output for the channel whenever
              a newline character is  output;   otherwise  output
              will  be  flushed  only  when a buffer fills or the
              flush command  is  invoked.   The  default  is  for
              -linemode  to  be off except for channels that con-
              nect to terminal-like devices.

       -translation mode
              In Tcl scripts the end of a line is  always  repre-
              sented  using a single newline character (\0.  How-
              ever, in actual files and devices the end of a line
              may   be   represented   differently  on  different
              platforms, or even for  different  devices  on  the
              same  platform.   For  example, under UNIX newlines
              are used in files, whereas carriage-return-linefeed
              sequences are normally used in network connections.
              The Tcl I/O system automatically translates between
              the  newlines  used internally and whatever end-of-
              line characters are appropriate for the  underlying
              files and devices.  The -translation option selects
              the end-of-line character(s) to use on the file  or
              device  for a particular channel.  Note that if you
              want no translations at all applied  to  input  and
              output  on a specific channel, you should set it to
              lf mode - see below.  The following values are cur-
              rently supported:

              cr     The  end of a line in the underlying file or
                     device is represented by a  single  carriage
                     return  character.   During  input  commands
                     such as read Tcl translates carriage returns
                     to  newline  characters,  and  during output
                     commands such as puts Tcl translates newline
                     characters  to  carriage returns.  This mode
                     is typically used on Macintosh platforms.

              crlf   The end of a line in the underlying file  or
                     device  is  represented by a carriage return
                     character followed by a linefeed  character.
                     During  input  commands  such  as  read  Tcl
                     translates          carriage-return-linefeed
                     sequences  to  newlines,  and  during output
                     commands such as puts Tcl translates newline
                     characters    to    carriage-return-linefeed
                     sequences.  This mode is typically  used  on
                     Windows  platforms  and  for network connec-
                     tions.

              lf     The end of a line in the underlying file  or
                     device  is  represented  by a single newline
                     (linefeed)  character.   In  this  mode   no
                     translations  occur  during either intput or
                     output.  This mode is typically used on UNIX
                     platforms.

              platform
                     Tcl chooses a translation mode for the chan-
                     nel according to the platform on  which  the
                     application is executing; for sockets on all
                     platforms Tcl chooses  crlf,  for  all  Unix
                     flavors,  it  chooses  lf, for the Macintosh
                     platform it chooses cr and for  the  various
                     flavors of Windows it chooses crlf.

              auto   In  this  mode Tcl sets the translation mode
                     based  on  the   first   valid   end-of-line
                     sequence  it  sees during input on the chan-
                     nel.  If output is generated for the channel
                     before  an end-of-line sequence has appeared
                     on input, then Tcl uses  platform  mode  for
                     the  channel.   The default -translation for
                     channels is auto.



SEE ALSO
       close(n), flush(n), gets(n), puts(n), read(n)


KEYWORDS
       blocking, buffering, carriage return, end of line,  flush-
       ing, linemode, newline, nonblocking, platform, translation
