Creates a chan pipe facade around another channel, making it possible, for example to use a reflected channel with <@. Can also be used to work around the fact that exec (and therefore open) ignore encoding and translation in the case of <@.
chan provides various operations on a channel, including many that have been available using a mix of other commands. action indicates what to do with the channel. Any unique abbreviation for an action is acceptable. The valid actionss are:
AMG: chan aggregates all the commands you'll need for working with channels, except creating traditional channels (it can only create pipes and reflected channels). Use open or socket or an extension command, same as always. If you find a core channel command not incorporated as a chan subcommand, please report it.
Renamed actions (available as another command as well)
RS: History sometimes runs in circles... Tcl 2.1 didn't have commands dealing with channels. Peter da Silva added the "stream" extension, where one could write
stream fp open $filename r
set x [stream fp gets]
stream fp close
Later, the parts of "stream" went into the core as separate commands. Still later, in 8.5, they get reunited again in chan, which arguably makes the command set leaner, but scripts wordier...