On Friday, October 8, 2021 at 12:05:39 PM UTC+2, Jean-Baptiste Gardette wrote:
Hi,
Windows 7
Tcl 8.6.11
java 1.8.0_291
I create a standalone pipe with chan pipe command to redirect stderr from a subprocess java (executed in background with exec command). See following code :
lassign [chan pipe] readSide writeSide
exec ... 2>@ $writeSide &
close $writeSide
chan event $readSide readable {
# read stderr
}
I have some questions :
What is the best way to read the stderr ? read or gets command ?
If I use the read command, do I configure readSide in non-blocking mode to read without wait an end-of-file ?
Thank
Jean-Baptiste
I think you should use the fileevent command (see for instance
https://wiki.tcl-lang.org/page/fileevent). The tutorial has a few straightforward examples at
https://wiki.tcl-lang.org/page/Tcl+Tutorial+Lesson+26a.
Regards,
Arjen
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)