Peter Bočan
unread,Oct 14, 2024, 5:57:07 PM10/14/24Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
Hello Community,
I am writing a small binary which watches the subprocesses it launches. However, I have noticed that cmd.StdoutPipe and cmd.StderrPipe returns io.ReadCloser/io.File, which also, in itself blocks when reading.
What is the recommended way of reading whatever is on the buffer and return back without blocking? It looks like a bit of a rabbit hole. Is setting the nonblocking flag using syscall recommended?
Kindly,
Peter.