close.n

来自「tcl是工具命令语言」· N 代码 · 共 69 行

N
69
字号
'\"'\" Copyright (c) 1993 The Regents of the University of California.'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.'\"'\" See the file "license.terms" for information on usage and redistribution'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.'\" '\" RCS: @(#) $Id: close.n,v 1.4 2001/09/14 19:20:40 andreas_kupries Exp $'\" .so man.macros.TH close n 7.5 Tcl "Tcl Built-In Commands".BS'\" Note:  do not modify the .SH NAME line immediately below!.SH NAMEclose \- Close an open channel..SH SYNOPSIS\fBclose \fIchannelId\fR.BE.SH DESCRIPTION.PPCloses the channel given by \fIchannelId\fR..PP.VS\fIChannelId\fR must be an identifier for an open channel such as aTcl standard channel (\fBstdin\fR, \fBstdout\fR, or \fBstderr\fR),the return value from an invocation of \fBopen\fR or \fBsocket\fR, orthe result of a channel creation command provided by a Tcl extension..VE.PPAll buffered output is flushed to the channel's output device,any buffered input is discarded, the underlying file or device is closed,and \fIchannelId\fR becomes unavailable for use..VS "" br.PPIf the channel is blocking, the command does not return until all outputis flushed.If the channel is nonblocking and there is unflushed output, thechannel remains open and the commandreturns immediately; output will be flushed in the background and thechannel will be closed when all the flushing is complete..VE.PPIf \fIchannelId\fR is a blocking channel for a command pipeline then\fBclose\fR waits for the child processes to complete..VS "" br.PPIf the channel is shared between interpreters, then \fBclose\fRmakes \fIchannelId\fR unavailable in the invoking interpreter but has noother effect until all of the sharing interpreters have closed thechannel.When the last interpreter in which the channel is registered invokes\fBclose\fR, the cleanup actions described above occur. See the\fBinterp\fR command for a description of channel sharing..PPChannels are automatically closed when an interpreter is destroyed andwhen the process exits.  Channels are switched to blocking mode, to ensurethat all output is correctly flushed before the process exits..VE.PPThe command returns an empty string, and may generate an error ifan error occurs while flushing output..SH "SEE ALSO"file(n), open(n), socket(n), eof(n), Tcl_StandardChannels(3).SH KEYWORDSblocking, channel, close, nonblocking

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?