[Top][All Lists]

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

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

From: Pádraig Brady
Subject: Re: dd: add 'skip_bytes' and 'count_bytes' operands
Date: Mon, 13 Feb 2012 14:31:07 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0

On 02/13/2012 02:28 PM, Bernhard Voelker wrote:
> 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.

In other words, I'm not sure this is an issue

> 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

seek is for output, skip is for input.


reply via email to

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