fconfigure
fconfigure channelId ?-option value ...?
Gives or sets the options of a channel: -blocking, -buffering (full, line, or none), -buffersize, -encoding (utf-8, binary, ascii, unicode, or an encoding file of encoding dirs), -translation (auto, lf, crlf, or binary), and -eofchar. In Tcl 9.1 a channel also has -profile (strict by default, replace, or tcl8): with strict, bad UTF-8 input is an error of the read. A socket also has -sockname and -peername. A serial port has the options below. chan configure is the same command.
Options
| Option | What it does |
|---|---|
-mode baud,parity,data,stop |
A serial port: the baud, the parity (n, o, e, m, or s), the data bits (5 to 8), and the stop bits (1 or 2), for example 115200,n,8,1. Linux takes any baud. macOS has no m or s. |
-handshake type |
A serial port: none, rtscts, xonxoff, or dtrdsr (Windows only). It sets the flow control. A read gives no value. |
-xchar {xon xoff} |
A serial port: the two characters of xonxoff. |
-ttycontrol {signal value ...} |
A serial port: sets the lines RTS, DTR, and BREAK, for example {DTR 0 RTS 1}. A read gives no value. |
-ttystatus |
A serial port, read only: a dict of the lines CTS, DSR, RING, and DCD. |
-queue |
A serial port, read only: the counts of bytes in the input queue and the output queue of the system. |
Facts
- Capability:
channels. A new interpreter does not have this command. See Limits and capabilities. - Compute cost: one compute unit for the call, and more for the commands that it runs.