[COFF] Shell script advice: using 'dd' to write multiple media

Clem Cole clemc at ccc.com
Tue Jun 27 09:32:37 AEST 2023


On Mon, Jun 26, 2023 at 7:09 PM steve jenkin <sjenkin at canb.auug.org.au>
wrote:

>
>
> I’ve never figured out how to use ‘dd’ so it returns after a single block
> is written
> doesn’t close the input, killing the pipeline, or cause the rest of the
> data
> to be discarded.
>

The trick here is understanding how ibs & obs, EOF is handled and probably
osync, then how to use iseek (iskip in modern versions).
It's not that hard. Its been done many times.

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.
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.

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).
ᐧ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.tuhs.org/pipermail/coff/attachments/20230626/0f3ecf75/attachment.htm>


More information about the COFF mailing list