:: Re: [DNG] OT: redirecting piped / p…
Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Ludovic Bellière
Ημερομηνία:  
Προς: Florian Zieboll
Υ/ο: [DNG]
Αντικείμενο: Re: [DNG] OT: redirecting piped / processed stderr to a file
On Mon, 14 Mar 2022, Florian Zieboll via Dng wrote:

>> Reading the pipe man page ('man 7 pipe') tells us that there are two
>> ends to a pipe: read and write. Each of them are affected by the
>> buffer settings. Most likely 'rsync' outputs is being buffered before
>> landing on 'tr'.
>
>So I assume that it is 'tr' which recognizes that rsync's output is
>already buffered and thus keeps this setting - while the output of 'dd'
>comes in another format and 'tr' decides that it would be a good idea
>to 4k-buffer it before passing it on?
>


The 4k buffer would be the "default", which may differ per system.
Reading the man page (again) tells me that the default pipe capacity is
16 pages (65,536 bytes in a system with a page size of 4096 bytes). The
4k buffer thing was valid for old kernels.

>
>> Looking at how you use stdbuff, you seem to only
>> define the output (write end) of the 'tr' command.
>
>Yes, unbuffering the input of 'tr' (from 'dd') does not have any
>effect.


There's probably buffer between 'rsync' and 'tr'. Checkout the
documentation for 'rsync --outbuf=N|L|B'.

Cheers,
                 Ludovic