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
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
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.
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
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