Consider the following Go code fragment:
cmd := exec.Command(program, arg0)
stdin, err := cmd.StdinPipe()
// produces error when b is too large
n, err := stdin.Write(b.Bytes())
Whenever b
is too large, Write()
returns an error. Having experimented with different size b
s, it would seem this occurs whenever the length of b
is longer than the Linux pipe buffer size. Is there a way around this? Essentially I need to feed large log files via stdin to an external script.