The fconfigure Command

The fconfigure command sets and queries several properties of I/O channels. The default settings for channels are suitable for most cases. If you do event-driven I/O you may want to set your channel into nonblocking mode. If you handle binary data, you should turn off end of line and character set translations. You can query the channel parameters like this:

fconfigure stdin
-blocking 1 -buffering none -buffersize 4096 -encoding
						iso8859-1 -eofchar {}-translation lf

Table 16-3 summarizes the properties controlled by fconfigure. They are discussed in more detail below.

Table 16-3. I/O channel properties controlled by fconfigure.
-blockingBlocks until I/O channel is ready: 0 or 1.
-bufferingBuffer mode: none, line, or full ...

Get Practical Programming in Tcl & Tk, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.