Re: [go-nuts] redirect already running processes stdout

2016-07-04 Thread Konstantin Khomoutov
On Fri, 1 Jul 2016 13:22:09 -0700 (PDT) ethanlewis...@gmail.com wrote: [...] > I have multiple applications that have a lot of command line flags and > didn't want to have to worry about executing them threw os.exec. But this is super-simple to have in fact. In the simplest case just stick os.Arg

Re: [go-nuts] redirect already running processes stdout

2016-07-01 Thread as . utf8
Most systems don't support this functionality without a kernel patch or debugger trick. You can manipulate the file descriptor before the process is born, everything afterwards is luck or system specific. In Go, you have a lot more power: os.Stdout, os. Stderr = os.Stderr, os.Stdout fmt.Prin

Re: [go-nuts] redirect already running processes stdout

2016-07-01 Thread ethanlewis787
Thanks for the answers ! I will check reptyr out. I have looked at trying to rewrite https://github.com/jerome-pouiller/reredirect which seems to be similar to what I am looking for. I want this because I would like to write a application to catch stdout of another process for logging purposes.

Re: [go-nuts] redirect already running processes stdout

2016-07-01 Thread Konstantin Khomoutov
On Fri, 1 Jul 2016 10:28:59 -0700 (PDT) ethanlewis...@gmail.com wrote: > I am starting to look into intercepting a running processes output. I > know how to do this manually by look at /proc/$PID/fd/1 or by using > gdb etc. I do not want to use os.exec and then join the child > processes output wi

[go-nuts] redirect already running processes stdout

2016-07-01 Thread ethanlewis787
I am starting to look into intercepting a running processes output. I know how to do this manually by look at /proc/$PID/fd/1 or by using gdb etc. I do not want to use os.exec and then join the child processes output with the parent. I want to start Process A and capture the output of A in Proc