Re: dd in loop doesn't transfer full blocks
jim <[email protected]> Wed, 6 Oct 2010 09:05:29 -0700 (PDT)
| Newsgroups | gmane.comp.gnu.utils |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <c5cbe534-80ae-4a62-a635-b85b2c5cd91a@t20g2000yqa.googlegroups.com> |
On Oct 6, 2:37 am, Henrik Carlqvist <[email protected]> wrote: > jim <[email protected]> wrote: > > while $not_finished > > do dd bs=$BS count=1 > > The problem is that dd never transfers a full block; $BS is about > > 400000, and each time through the loop, dd only transfers about 73xxx > > bytes, and sometimes less. > > Is $BS a multiple of something? If so, maybe it would help to do something > like: > > do dd bs=`echo $BS/8 | bc` count=8 thanks; I actually thought of something similar after I posted here; but I really want a method that doesn't depend on my guessing correctly a number (8 in your example) that _might_ make the problem go away, but also might not. It looks as if the right thing to do is to restructure the program so as to eliminate the race/timimg issue, but it's not clear to me how to do that. What I'm trying to do is, even more abstractly: repeat copy the next $BS bytes generate new label and insert it into data stream end The only reason for the pipe is to not have to restart the decompression (and then skip) for each new block of data.