<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 26, 2023 at 7:09 PM steve jenkin <<a href="mailto:sjenkin@canb.auug.org.au">sjenkin@canb.auug.org.au</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
I’ve never figured out how to use ‘dd’ so it returns after a single block is written<br>
doesn’t close the input, killing the pipeline, or cause the rest of the data<br>
to be discarded.<br></blockquote><div><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">The trick here is understanding how ibs & obs, EOF is handled and probably osync, then how to use iseek (iskip in modern versions).</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">It's not that hard. Its been done many times. </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">One of the more interesting issues with dd is most versions still are single threaded which sucks for most media - particularly f you want to stream things.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">There was a wonderful hack to dd done in the. early 1980s by Tapani Lindgren ddd - double dd - which used two processes and a pipe to control them, so one process was always reading while the other was writing.   You can one it Volume 14, issue 85 in the comp.sources.unix archives.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Years ago, I hacked up a version using threads to do the same thing with a mutex to protect everything (It ever ran on Windows at some point). </div></div></div><div hspace="streak-pt-mark" style="max-height:1px"><img alt="" style="width:0px;max-height:0px;overflow:hidden" src="https://mailfoogae.appspot.com/t?sender=aY2xlbWNAY2NjLmNvbQ%3D%3D&type=zerocontent&guid=f5a7e31b-c7a3-4e28-9199-ad9e6a0f4637"><font color="#ffffff" size="1">ᐧ</font></div>