bug-tar
[Top][All Lists]
Advanced

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

[Bug-tar] Autodetecting compressed data (was: obsolescent base-64 header


From: Gunnar Ritter
Subject: [Bug-tar] Autodetecting compressed data (was: obsolescent base-64 headers)
Date: Mon, 20 Sep 2004 18:33:17 +0200
User-agent: nail 11.8pre 9/20/04

Paul Eggert <address@hidden> wrote:

> or you're forgetting to use the "j" option, or something like that.

By the way, why doesn't GNU tar autodetect compressed data? I'm
using the following procedure in my implementations:

If

(1) no ustar magic is present, and the bytes in the magic field are not
    all zero;

(2) the tar header checksum of the first 512 bytes is not correct;

(3) tar is not advised to ignore checksum errors;

(4) the first few bytes contain a gzip, bzip2, or compress magic;

then tar automatically invokes an appropriate decompressor.

Since the decompressor is only invoked on data that tar would reject
after (2) and (3) anyway, I think that this proceduce is safe not to
produce any false positives.

Wouldn't a similar behavior be useful for GNU tar too? I often hear
people curse on the lack of such autodetection if they forgot 'z',
or specified 'z' instead of 'j', etc.

        Gunnar




reply via email to

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