NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/41072: dd ignores bs= when if= comes from stdin
The following reply was made to PR bin/41072; it has been noted by GNATS.
From: "Perry E. Metzger" <perry%piermont.com@localhost>
To: SODA Noriyuki <soda%yuruyuru.net@localhost>
Cc: gnats-bugs%NetBSD.org@localhost, gnats-admin%netbsd.org@localhost,
netbsd-bugs%netbsd.org@localhost
Subject: Re: bin/41072: dd ignores bs= when if= comes from stdin
Date: Wed, 25 Mar 2009 09:10:33 -0400
SODA Noriyuki <soda%yuruyuru.net@localhost> writes:
>> try
>> something.... | dd of=/dev/somepartition bs=10m progress=1
>> and note that you get way too many dots printed.
>
> That's not a bug, but documented behavior:
>
> bs=n Set both input and output block size, superseding
> the ibs and obs operands. If no conversion values
> other than noerror, notrunc or sync are specified,
> then each input block is copied to the output as
> a single block without any aggregation of short
> blocks.
>
> Please note the following sentence, especially:
> If no conversion values other than noerror, notrunc or sync
> are specified, then each input block is copied to the output
> as a single block without any aggregation of short blocks.
> i.e. In this case, dd preserve the return size of the read(2)
> system calls at the corresponding write(2) operation.
>
> This behavior is needed to copy a variable-blocksize tape with
> preserving each size of tape blocks.
Okay, the phrase "without any aggregation of short blocks" is somewhat
confusing to me. I would suggest that it be explained a bit
better. How about adding, at the end of the paragraph:
This behavior is needed to copy a variable-blocksize tape with
preserving each size of tape blocks. However, it may result in
unexpected behavior when short reads are likely, such as when
reading from a pipe on stdin. In such cases, set obs= alone.
Actually, though, is there a conv= setting that says "always
aggregate"? (I don't seem to see one.)
Perry
Home |
Main Index |
Thread Index |
Old Index