coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dd: add 'skip_bytes' and 'count_bytes' operands


From: Bernhard Voelker
Subject: Re: dd: add 'skip_bytes' and 'count_bytes' operands
Date: Mon, 13 Feb 2012 15:28:31 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20120129 Thunderbird/10.0


On 02/13/2012 02:09 PM, Pádraig Brady wrote:
>> BTW: shouldn't
>> >    echo abcdefghijklm | src/dd bs=5 seek=8 oflag=seek_bytes
>> > receive EPIPE? When run on a terminal, dd waits in read() forever.
> True. That's because we try to seek using read()
> on non seekable files, and stdout is readable by default,
> so we'll hang waiting for input from the terminal.
> I.E. this will block:
> 
>   dd seek=1 if=/dev/null
> 
> Not sure what to do there.

Hmm, the process writing into the pipe has already exited,
so I don't get why read() doesn't return eof.

Using O_NONBLOCK if reading from stdin?
Strangely, using iflag=nonblock also blocks ;-(

  echo abcdefghijklm | src/dd bs=5 seek=8 iflag=nonblock

Have a nice day,
Berny



reply via email to

[Prev in Thread] Current Thread [Next in Thread]