''The "rchan" command is now part of CritLib [http://www.equi4.com/critlib]'' and it is now called "rechan". ---- This package defines an "rchan" command, which lets you create Tcl-style channels that are completely handled by Tcl scripts, instead of C code. The rchan extension itself is written in C, and requires [CriTcl] to turn it into an extension (on the fly) Rchan must be called with two arguments to create a new channel: rchan cmd mode Where: cmd = the name of the "callback" that will process requests mode = the open mode: 2 is read only (not thourgly tested yet) 4 is write only (not thourgly tested yet) 6 is R/W, the normal case The callback cmd can be one or more words (i.e. a list). Depending on the operation, a request name and some args will be tacked on before invoking it. The following requests are implemented: $cmd seek $chan ?? called when a "seek $chan ??" is done $cmd read $chan called when a "read $chan " request is made $cmd write $chan called when a "write $chan " request is made Other operations are not supported (close, for example, so the caller must keep track of this channel and clean up as appropriate - which is messy). Rchan is not all that capable, it does not work well with fileevents, and in general it definitely could use some re-work and modernization. But it has been invaluable in TclKit to implement its database-backed VFS design. Without some sort of "reflection", the Virtual File System (whether the original one by Matt Newman or the C-based on in the core by Vince Darley) could not have been implemented. It is hoped that one day, some sort of channel reflection becomes part of standard Tcl, and included in the core. Nov 2003 status - close is now also tracked, and file-event friendliness is ok now. (This is not new, but as this page appears to have been edited recently, I thought I'd update the facts about it as well) -[jcw] ---- [PWQ] ''19 Feb 05'', surely you jest, ''mode = 2,4,6''?. You really mean '''mode = r,w,r+||w+''' do you not?