On Wed, Sep 30, 2020 at 5:17 PM Patrick Smith <pat42sm...@gmail.com> wrote:

> Not a general solution, but if you are only writing a small amount of
> data, you can simply write it to the pipe and then exec the other program:
> https://play.golang.org/p/e0UQRE6SsT4
>
> If I recall correctly, many years ago you would have been able to write
> 256 bytes this way. No doubt someone else can tell you the current limit.
>

It's platform dependent. I've been programming for a living since 1979 and
doing so on UNIX since ~1985. I can't recall any implementation where the
pipe buffer was less than 512 bytes; although it wouldn't surprise me if
the very first UNIX implementation running on a PDP-11 used the 256 byte
buffer you mention. These days you can safely assume at least a 4 KiB
buffer.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CABx2%3DD_b9PEQ81OrdduDn9BH797T0qE7nq1rn9qPUejtun8vkg%40mail.gmail.com.

Reply via email to