bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] Warning message when reading partial blocks from stdin.


From: Gunnar Ritter
Subject: Re: [Bug-tar] Warning message when reading partial blocks from stdin.
Date: Tue, 19 Apr 2005 20:19:31 +0200
User-agent: nail 11.23pre 4/15/05

Paul Eggert <address@hidden> wrote:

> Gunnar Ritter <address@hidden> writes:
> > Joerg Schilling <address@hidden> wrote:
> >> The standard requires the tar archives to be blocked with a multiple of
> >> 512 bytes.
> > And what, exactly, is the point in requiring this when reading parts of
> > archives that are completely meaningless?
> Minor reasons, I suspect.  It reflects historical practice.

Really? 7th edition tar checks the number of bytes returned after the
first call to read() only. It then assumes that all following read()
calls return the same size and will thus simply ignore any junk at the
end unless the archive is very small. The same applies to 4.3BSD tar
and probably to many System V derivatives too.

> It allows programs like "tar" to warn the user in some cases where
> junk has been accidentally appended to the archive.

As you say, even GNU tar only does this "in some cases" so if you
actually see an advantage here, it is currently not reliable. In
particular, GNU tar just ignores any amount of junk that exceeds
a few blocks.

Also some traditional tar implementations (7th edition and many
System V derivatives) do not truncate an existing regular file when
they write an archive onto it. Junk beyond the end of the archive
is thus a regular condition with them.

> It allows programs to copy tar archives to archival devices that
> accept data only in 512-byte blocks.

I am referring to the behavior of tar when reading archives. It
should certainly align its output.

        Gunnar




reply via email to

[Prev in Thread] Current Thread [Next in Thread]