Add an option "-J" / "--pipe-buffer-size" to set the size of the output pipe buffer when the output is a pipe, and when that option is not specified, automatically increase the output pipe buffer size to match that of the input, when the first input is also a pipe (#188).

This commit is contained in:
Andrew Wood
2026-05-02 16:42:35 +01:00
parent d421024fb8
commit 17cbab3045
10 changed files with 84 additions and 9 deletions
+12 -4
View File
@@ -291,6 +291,14 @@ automatically switches on \*(lq\fB\-\-no\-splice\fR\*(rq.
Switching on this option results in a small loss of transfer efficiency.
It has no effect on systems where \fBsplice\fR(2) is unavailable.
.TP
.BI \-J\ BYTES \fR,\ \fB\-\-pipe\-buffer\-size\ BYTES
Attempt to set the size of the output pipe buffer to \fIBYTES\fR bytes.
This will only have an effect if the output is a pipe, and will silently do
nothing if the requested size cannot be achieved.
If this option is not specified, and both the output and the first input are
pipes, then the output pipe buffer size will automatically be increased to
match the input pipe buffer, if it was smaller.
.TP
.B \-E, \-\-skip-errors
Ignore read errors by attempting to skip past the offending sections.
The corresponding parts of the output will be null bytes.
@@ -857,10 +865,10 @@ effective with small input files, and \*(lq\fB%nL\fR\*(rq may be a few lines
out due to buffering within the pipeline itself.
.PP
Numbers passed to \*(lq\fB\-\-size\fR\*(rq, \*(lq\fB\-\-rate\-limit\fR\*(rq,
\*(lq\fB\-\-buffer\-size\fR\*(rq, and \*(lq\fB\-\-error\-skip\-block\fR\*(rq
may all be expressed as decimals if followed by a suffix, so for example
\*(lq\fI\-\-size\~1.5G\fR\*(rq is equivalent to
\*(lq\fI\-\-size\~1536M\fR\*(rq.
\*(lq\fB\-\-buffer\-size\fR\*(rq, \*(lq\fB\-\-pipe\-buffer\-size\fR\*(rq,
and \*(lq\fB\-\-error\-skip\-block\fR\*(rq may all be expressed as decimals
if followed by a suffix, so for example \*(lq\fI\-\-size\~1.5G\fR\*(rq is
equivalent to \*(lq\fI\-\-size\~1536M\fR\*(rq.
.PP
Numbers passed to \*(lq\fB\-\-interval\fR\*(rq and
\*(lq\fB\-\-delay\-start\fR\*(rq may be integers or decimals, but may not
+13 -3
View File
@@ -300,6 +300,15 @@ are explicitly switched on will be shown.
option results in a small loss of transfer efficiency. It has no
effect on systems where **splice**(2) is unavailable.
**-J BYTES, \--pipe-buffer-size BYTES**
: Attempt to set the size of the output pipe buffer to *BYTES* bytes.
This will only have an effect if the output is a pipe, and will
silently do nothing if the requested size cannot be achieved. If
this option is not specified, and both the output and the first
input are pipes, then the output pipe buffer size will automatically
be increased to match the input pipe buffer, if it was smaller.
**-E, \--skip-errors**
: Ignore read errors by attempting to skip past the offending
@@ -814,9 +823,10 @@ small input files, and "**%nL**" may be a few lines out due to buffering
within the pipeline itself.
Numbers passed to "**\--size**", "**\--rate-limit**",
"**\--buffer-size**", and "**\--error-skip-block**" may all be expressed
as decimals if followed by a suffix, so for example "*\--size 1.5G*" is
equivalent to "*\--size 1536M*".
"**\--buffer-size**", "**\--pipe-buffer-size**", and
"**\--error-skip-block**" may all be expressed as decimals if followed
by a suffix, so for example "*\--size 1.5G*" is equivalent to
"*\--size 1536M*".
Numbers passed to "**\--interval**" and "**\--delay-start**" may be
integers or decimals, but may not have a suffix.