Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Jan 2004 21:37:50 -0800 (PST)
From:      Don Lewis <truckman@FreeBSD.org>
To:        tjr@FreeBSD.org
Cc:        kientzle@acm.org
Subject:   Re: Request for Comments: libarchive, bsdtar
Message-ID:  <200401150537.i0F5bo7E041482@gw.catspoiler.org>
In-Reply-To: <20040114234829.GA19067@cat.robbins.dropbear.id.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On 15 Jan, Tim Robbins wrote:

> - Padding gzip'd tar archives (with bsdtar czf) causes gzip to report
>   "trailing garbage" and fail, and in turn this causes GNU tar to fail.
>   BSD pax (-wzf) and GNU tar (czf) do not pad compressed archives.

In the case of GNU tar, it depends on where it is writing.  It pads when
writing to stdout, but does not pad when writing to a file.  I would
hope that it pads when writing to a tape device, since many tapes
require writing to some multiple of their native block size.

% tar cfz /tmp/printcap.tgz /etc/printcap
tar: Removing leading `/' from member names
% ls -l /tmp/printcap.tgz
-rw-r--r--  1 dl  wheel  1216 Jan 14 21:28 /tmp/printcap.tgz
% tar cfz - /etc/printcap > /tmp/printcap.tgz
tar: Removing leading `/' from member names
% ls -l /tmp/printcap.tgz
-rw-r--r--  1 dl  wheel  10240 Jan 14 21:28 /tmp/printcap.tgz

I would prefer to have explicit control of this behavior.

BTW, on a Unix variant that I used many years ago, there was an enhanced
version of dd, called ddx, which had the useful option "mobs", which was
used to specify a minimum output block size.  You could run something
like
	ddx obs=10k mobs=1k ...
to cause all writes to be blocked to 10k except for the last partial
write which would be padded out to at least 1k.  I don't remember what
it did if there was 1025 bytes left over for the last write ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200401150537.i0F5bo7E041482>