GNU bug report logs - #15680
dd: suggest iflag=fullblock ... but only if count > 1

Previous Next

Package: coreutils;

Reported by: Bernhard Voelker <mail <at> bernhard-voelker.de>

Date: Tue, 22 Oct 2013 06:49:02 UTC

Severity: normal

Tags: notabug

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #15 received at control <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Bernhard Voelker <mail <at> bernhard-voelker.de>
Cc: 15680 <at> debbugs.gnu.org
Subject: Re: bug#15680: dd: suggest iflag=fullblock ... but only if count > 1
Date: Tue, 22 Oct 2013 10:25:49 +0100
tag 15680 notabug
close 15680
stop

On 10/22/2013 07:47 AM, Bernhard Voelker wrote:
> dd(1) issues a nice warning about short reads ...
> 
>   src/dd if=/dev/random of=sample bs=1000 count=2
>   src/dd: warning: partial read (128 bytes); suggest iflag=fullblock
>   0+2 records in
>   0+2 records out
>   256 bytes (256 B) copied, 0.000423371 s, 605 kB/s
> 
> ... but only if count was > 1:
> 
>   src/dd if=/dev/random of=sample bs=1000 count=1
>   0+1 records in
>   0+1 records out
>   128 bytes (128 B) copied, 0.000270231 s, 474 kB/s
> 
> Is this by intension or an off-by-one?
> I'd like to provide a patch in the latter case.

The various cases for warning were disucussed at:
http://bugs.gnu.org/7362

Also I mentioned this particular case with count at:
http://bugs.gnu.org/9734#18

Copying from there...

"Note the particular case where count=1 is not warned about,
as with a single read, one doesn't know if we're just at EOF.
Also it's probably a quite common idiom to, consume available data
up to $bs bytes."

thanks,
Pádraig.




This bug report was last modified 11 years and 272 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.