42. Channels
Tcl provides an extremely flexible system for managing input and output based on the concept of channels. You are probably familiar with file and TCP socket channels at the Tcl level. They are two of the channel types that Tcl itself provides. The channel system was created in order to provide a flexible, extensible, cross-platform, device-independent means of dealing with input and output. The channel design takes a two-tiered approach: from Tcl, or using a high-level approach in C, all channels are used in more or less the same way. Standard operations such as puts, read, chan flush, and so forth are the same for all channels, whatever lowlevel device (files, TCP sockets, real hardware devices, etc.) implements them. Lower-level ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access