IPC via named pipe: Difference between revisions

(→‎{{header|Tcl}}: Added zkl)
Line 367:
 
fcn readLoop(pipe){ // a thread
while(1){ tally:=0;
in:=File("in","r").howza(3); // open for read, reading characters
while(1){ // named pipe sets EoF after writer exits
foreach c in (in){ pipe.write(tally+=1) } // read bytes until EoF
in.close();
}
in.close();
println("readLoop done");
}.launch(pipe);
Anonymous user