Seth Woolley's Man Viewer

Manual for close - man n close

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

close(2,7,n)(n)                     Tcl Built-In Commands                    close(2,7,n)(n)



NAME
       close(2,7,n) - Close an open(2,3,n) channel.

SYNOPSIS
       close(2,7,n) channelId


DESCRIPTION
       Closes the channel given by channelId.

       ChannelId must be an identifier for an open(2,3,n) channel such as a Tcl stan-
       dard channel (stdin, stdout, or stderr), the return value from an invo-
       cation  of  open(2,3,n) or socket(2,7,n), or the result of a channel creation command
       provided by a Tcl extension.

       All buffered output is flushed to  the  channel's  output  device,  any
       buffered  input  is discarded, the underlying file(1,n) or device is closed,
       and channelId becomes unavailable for use.

       If the channel is blocking, the command does not return until all  out-
       put  is  flushed.  If the channel is nonblocking and there is unflushed
       output, the channel remains open(2,3,n) and the command  returns  immediately;
       output will be flushed in(1,8) the background and the channel will be closed
       when all the flushing is complete.

       If channelId is a blocking channel for a command  pipeline  then  close(2,7,n)
       waits for the child processes to complete.

       If  the  channel is shared between interpreters, then close(2,7,n) makes chan-
       nelId unavailable in(1,8) the invoking interpreter but has no  other  effect
       until  all  of  the sharing interpreters have closed the channel.  When
       the last interpreter in(1,8) which the channel is registered invokes  close(2,7,n),
       the cleanup actions described above occur. See the interp command for a
       description of channel sharing.

       Channels are automatically closed when an interpreter is destroyed  and
       when  the  process  exits.   Channels are switched to blocking mode, to
       ensure that all output is correctly flushed before the process exits.

       The command returns an empty string(3,n), and may generate an  error(8,n)  if(3,n)  an
       error(8,n) occurs while flushing output.


SEE ALSO
       file(1,n)(n), open(2,3,n)(n), socket(2,7,n)(n), eof(n), Tcl_StandardChannels(3)


KEYWORDS
       blocking, channel, close(2,7,n), nonblocking



Tcl                                   7.5                             close(2,7,n)(n)

References for this manual (incoming links)