'''pipe ?fileId_var_r ?fileId_var_w''' Create a pipe. If fileId_var_r and fileId_var_w are specified, then pipe will set the a variable named fileId_var_r to contain the fileId of the side of the pipe that was opened for reading, and fileId_var_w will contain the fileId of the side of the pipe that was opened for writing. If the fileId variables are not specified, then a list containing the read and write fileIdw is returned as the result of the command. There is a proposal in [tclx file commands for core] to move this command into Tcl's source code. ---- Note that the above mentioned [Tclx] command is a method of explicitly constructing the abstract notion of a computer ''pipe'' . [Tcl] itself already has one means of interacting with a pipe. The Tcl [open] command has the ability to create pipes to commands. So, what is a pipe? A pipe is a software construct whereby one builds a first-in first-out (FIFO) data container, into which one can write any sort of data, with the expectation that some other piece of code (perhaps even in another process) will read this data and be able to manipulate it. The first place I ([LV]) ever saw pipes were on the first Unix system I ever used, with the Bourne shell. In that setup, programs frequently were written which would produce some sort of ascii newline terminated output, written to [stdout], which would be connected to a ''pipe''. One would then, on the other ''end'' of the pipe, one would run another process. The pipe would be attached to that program's [stdin]. An example might be: ls -l /etc | grep passwd This command tells the shell to execute the ls command, with the -l and /etc arguments. The '''|''' symbol indicates to Bourne that the stdout of ls should be attached to the pipe. The notation also, ''simultaneously'' indicates that the bourne shell should start a second process, whose stdin is attached to that same pipe. In the second process, Bourne is to start the grep command with one argument - the string "passwd". The result would be the output of zero or more files containing the letters "passwd" which reside in /etc . ---- Can somebody give an example for this? My attempt to use package require Tclx pipe rpipe wpipe; puts $wpipe "test\n"; read $wpipe simply leads to a lock up. Any help appreciated ;). ---- The problem is that read tries to read to the end of file. Since a pipe does not have an end of file indication ( unless one of the ends is closed) read never returns. An example with gets and an example with read are given below. In both the gets and read examples you must flush the pipe before anything will show up on the read end. package require Tclx pipe rpipe wpipe; puts $wpipe "test" flush $wpipe puts "[gets $rpipe]" For the read example, supplying a large capture size to the read command will make it less likely you will have to loop more than once. Also critical to using read was using fconfigure to make the read pipe non-blocking. package require Tclx pipe rpipe wpipe; fconfigure $rpipe -blocking 0 puts $wpipe "test" flush $wpipe set buff "" set done 0 while { !$done } { set appstr [ read $rpipe 1000 ] append buff $appstr if { [ string length $appstr ] != 1000 } { set done 1; } } puts "$buff" ---- [Category Command] for [TclX] package.