Computer Old Farts Forum
 help / color / mirror / Atom feed
From: Clem Cole <clemc@ccc.com>
To: steve jenkin <sjenkin@canb.auug.org.au>
Cc: COFF <coff@tuhs.org>
Subject: [COFF] Re: Shell script advice: using 'dd' to write multiple media
Date: Mon, 26 Jun 2023 19:32:37 -0400	[thread overview]
Message-ID: <CAC20D2NEMStT9Fd2a4dDDxPHVwtWpz8K4Bc7Qe6U1NT_9HVt2Q@mail.gmail.com> (raw)
In-Reply-To: <D0AEA7F2-9981-4AAF-8F52-3FCF79089394@canb.auug.org.au>

[-- Attachment #1: Type: text/plain, Size: 1080 bytes --]

On Mon, Jun 26, 2023 at 7:09 PM steve jenkin <sjenkin@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).
ᐧ

[-- Attachment #2: Type: text/html, Size: 2338 bytes --]

  parent reply	other threads:[~2023-06-26 23:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26 23:09 [COFF] " steve jenkin
2023-06-26 23:21 ` [COFF] " Dave Horsfall
2023-06-26 23:44   ` steve jenkin
2023-06-27 21:01     ` Dave Horsfall
2023-06-26 23:32 ` Clem Cole [this message]
2023-06-27  4:43   ` Steve Jenkin
2023-06-26 23:44 ` Bakul Shah
2023-06-27  3:47   ` Steve Jenkin
2023-06-27 15:50     ` Steffen Nurpmeso
2023-06-27 16:07       ` Steffen Nurpmeso
2023-06-27  0:25 ` segaloco via COFF
2023-06-27  6:23 ` Ralph Corderoy
2023-06-27  6:28   ` Adam Thornton
2023-06-27  6:33     ` Ralph Corderoy
2023-06-27  7:53   ` steve jenkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAC20D2NEMStT9Fd2a4dDDxPHVwtWpz8K4Bc7Qe6U1NT_9HVt2Q@mail.gmail.com \
    --to=clemc@ccc.com \
    --cc=coff@tuhs.org \
    --cc=sjenkin@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).