Re: RFE: enable buffering on null-terminated data

2024-03-20 Thread Carl Edquist via GNU coreutils General Discussion
On Tue, 19 Mar 2024, Zachary Santer wrote: On Tue, Mar 19, 2024 at 1:24 AM Kaz Kylheku wrote: But what tee does is set up _IONBF on its output streams, including stdout. So it doesn't buffer at all. Awesome. Nevermind. Yay! :D And since tee uses fwrite to copy whatever input is

Re: RFE: enable buffering on null-terminated data

2024-03-19 Thread Zachary Santer
On Tue, Mar 19, 2024 at 1:24 AM Kaz Kylheku wrote: > > But what tee does is set up _IONBF on its output streams, > including stdout. So it doesn't buffer at all. Awesome. Nevermind.

Re: RFE: enable buffering on null-terminated data

2024-03-18 Thread Kaz Kylheku
On 2024-03-17 17:12, Zachary Santer wrote: > On Thu, Mar 14, 2024 at 11:14 AM Carl Edquist wrote: > >> Where things get sloppy is if you add some stuff in a pipeline after your >> build script, which results in things getting block-buffered along the >> way: >> >> $ ./build.sh | sed

Re: RFE: enable buffering on null-terminated data

2024-03-17 Thread Zachary Santer
On Thu, Mar 14, 2024 at 11:14 AM Carl Edquist wrote: > Where things get sloppy is if you add some stuff in a pipeline after your > build script, which results in things getting block-buffered along the > way: > > $ ./build.sh | sed s/what/ever/ | tee build.log > > And there you will

Re: RFE: enable buffering on null-terminated data

2024-03-14 Thread Carl Edquist via GNU coreutils General Discussion
On Mon, 11 Mar 2024, Zachary Santer wrote: On Mon, Mar 11, 2024 at 7:54 AM Carl Edquist wrote: (In my coprocess management library, I effectively run every coproc with --output=L by default, by eval'ing the output of 'env -i stdbuf -oL env', because most of the time for a coprocess,

Re: RFE: enable buffering on null-terminated data

2024-03-11 Thread Zachary Santer
On Mon, Mar 11, 2024 at 7:54 AM Carl Edquist wrote: > > (In my coprocess management library, I effectively run every coproc with > --output=L by default, by eval'ing the output of 'env -i stdbuf -oL env', > because most of the time for a coprocess, that's whats wanted/necessary.) Surrounded by

Re: RFE: enable buffering on null-terminated data

2024-03-11 Thread Carl Edquist via GNU coreutils General Discussion
On Sun, 10 Mar 2024, Zachary Santer wrote: On Sun, Mar 10, 2024 at 4:36 PM Carl Edquist wrote: Out of curiosity, do you have an example command line for your use case? My use for 'stdbuf --output=L' is to be able to run a command within a bash coprocess. Oh, cool, now you're talking! ;)

Re: RFE: enable buffering on null-terminated data

2024-03-10 Thread Zachary Santer
On Sun, Mar 10, 2024 at 4:36 PM Carl Edquist wrote: > > Hi Zack, > > This sounds like a potentially useful feature (it'd probably belong with a > corresponding new buffer mode in setbuf(3)) ... > > > Filenames should be passed between utilities in a null-terminated > > fashion, because the null

Re: RFE: enable buffering on null-terminated data

2024-03-10 Thread Carl Edquist via GNU coreutils General Discussion
Hi Zack, This sounds like a potentially useful feature (it'd probably belong with a corresponding new buffer mode in setbuf(3)) ... Filenames should be passed between utilities in a null-terminated fashion, because the null byte is the only byte that can't appear within one. Out of

RFE: enable buffering on null-terminated data

2024-03-10 Thread Zachary Santer
Was "stdbuf feature request - line buffering but for null-terminated data" See below. On Sun, Mar 10, 2024 at 5:38 AM Pádraig Brady wrote: > > On 09/03/2024 16:30, Zachary Santer wrote: > > 'stdbuf --output=L' will line-buffer the command's output stream. > > Pretty useful, but that's looking