redirect - Tcl/Tk - Memchan - fifo - how to rename fifo as stdout in a tcl/tk application which has Memchan statically linked? -


i cross posted question on comp.lang.tcl.

i developing tcl/tk application (call rs) , want redirect stdout , stderr text box in tcl/tk application. using memchan achieve (i statically linked memchan application). unable rename fifo channel created stderr. (the same thing holds true stdout too)

for example, in following snippet, closing stderr , opening fifo stderr fifo channel remains named fifo0 not stderr.

 $ rs  rs> package require memchan  2.3  rs> chan names  stdin stdout stderr  rs> close stderr  rs> chan names  stdin stdout  rs> set stderr [fifo]  fifo0  rs> chan names  fifo0 stdin stdout 

i expected stderr instead of fifo0 when typed in last of chan names command.

but when use tclsh8.5 above sequence produces desired effect i.e fifo renamed stderr

 $ tclsh8.5  % package req memchan  2.3  % chan names  stdin stdout stderr  % close stderr  % chan names  stdin stdout  % set stderr [fifo]  fifo0  % chan names  stderr stdin stdout 

note: no fifo0 desired stderr.

can point out how reproduce behavior in tclsh8.5 in tcl/tk application rs.

since memchan doesn't produce channels backed file descriptor, can't replace standard channels (which correspond fds 0, 1 , 2).


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -