bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] [PATCH] tar: do not fail hardly when compressor just warns


From: Antonio Diaz Diaz
Subject: Re: [Bug-tar] [PATCH] tar: do not fail hardly when compressor just warns
Date: Sun, 28 Apr 2013 15:34:53 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7.11) Gecko/20050905

Pavel Raiskup wrote:
Use '--compres-program'-like API by the -Z, but also by -z, -J,
--lzop and --lzma options.

I oppose this, except perhaps for -Z.

AFAIK, tar files are compressible enough that none of those compressors has been reported as returning 2, and if important programs like GNU tar begin accepting an exit status of '2' as success for those compressors, it will prevent them from switching to the correct and sane API of bzip2 and lzip which allows callers to tell I/O errors (status 1) from invalid files (status 2).

It seems that pigz does not use the compress API.

Moreover, I think an even more complex patch would be needed for this to work also when tar automaticaly chooses the compressor by archive name extension.

Would it not be easier to make tar pass the '-f' flag to compress (and perhaps the compress-like compressors)?

$ dd if=/dev/urandom of=testfile bs=1K count=1024
$ ls -go testfile*
  -rw-r--r--  1 1048576 2013-04-28 15:04 testfile
$ compress testfile ; echo $?
  2
$ ls -go testfile*
  -rw-r--r--  1 1048576 2013-04-28 15:04 testfile
$ compress -f testfile ; echo $?
  0
$ ls -go testfile*
  -rw-r--r--  1 1415373 2013-04-28 15:04 testfile.Z
$


Best regards,
Antonio.



reply via email to

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