2
由於複雜的原因,我不得不劫持「puts」例程。我希望做的依據是什麼「流」不同的事情是TCL提出流:我可以知道什麼流是?標準輸出?標準錯誤?文件?
proc myPuts { stream msg } {
if < stream is stdout >
....
elseif < stream is stderr >
...
else
...
}
有一些方法來知道,如果流參數爲標準輸出,標準錯誤或從TCL內部的一個文件?
感謝,
對於字符串比較的問題,使用'eq',而不是''== - http://tcl.tk/man/tcl8.5/TclCmd/expr。 htm#M14 –
這是一個公平的警察 - 編輯,以反映你的觀點。 –