Tim Kientzle wrote:
If you look at the source code for "compress", you find
that the return code 2 is *only* used when compressing
files in-place.

The source code for what compress? Mine is this (and it does return 2 when compressing stdin to stdout):

$ compress -V
Based on compress.c,v 4.0 85/07/30 12:50:00 joe Release
Options: BITS = 16


It does not apply when compressing stdin to stdout.

$ echo foo | compress > /dev/null ; echo $?
2


I believe GNU tar forks compressors to compress from
stdin to stdout, so this should never occur.

Sadly this has already occurred. It is the cause of this long thread.

And the bad news is that, unlike when compressing files in-place, passing -f to compress does not make it return 0:

$ echo foo | compress -f > /dev/null ; echo $?
2


Given how inconsistent the documentation and the implementations of compress are, that it is obsolete, and that the compress format was not designed to allow integrity checks, I would like to make a proposal for the maintainers of tar to consider. What about removing *compression* support for compress from tar?

I mean, is anybody still *creating* tar.Z files?

And if there is somebody doing this, can't they use compress directly?:

$ echo foo > foo
$ tar -c foo | compress > foo.tar.Z ; echo $?
0


Best regards,
Antonio.


Reply via email to