[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: make 'dd conv=sync' pad last block
From: |
Paul Eggert |
Subject: |
Re: make 'dd conv=sync' pad last block |
Date: |
Sun, 06 Jun 2004 15:38:21 -0700 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
Scott Weikart <address@hidden> writes:
> The Solaris 9 man page for 'dd' shows it padding output blocks:
No, that example merely shows Solaris 9 'dd' writing to tape.
It doesn't mean that it's padding output blocks. And some
experimentation shows that Solaris 9 'dd' pads input blocks, not
output blocks:
$ echo hello | dd obs=1024k of=output conv=sync
0+1 records in
0+1 records out
$ ls -l output
-rw-rw-r-- 1 eggert eggert 512 Jun 6 15:28 output
>> You might try "dd ibs=128k obs=128k conv=sync".
>
> That technically works, but the results are not desirable.
>
> It reads a variable number of 2b block from tar, pads the input
> buffer to 128KB, then writes it out.
Ah, ok, how about this instead?
tar cbf 1 - whatever | dd obs=1024k | dd bs=1024k conv=sync
Not as nice as I'd like, but at least it'll run (both with GNU dd and
with Solaris dd).
Perhaps GNU 'dd' should have an option to pad output blocks, so that
you don't need two processes to solve your problem.