Xref: utzoo comp.sources.d:2032 comp.binaries.ibm.pc.d:126 Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!oliveb!jerry From: jerry@oliveb.olivetti.com (Jerry Aguirre) Newsgroups: comp.sources.d,comp.binaries.ibm.pc.d Subject: Re: compressing compressed stuff Message-ID: <21263@oliveb.olivetti.com> Date: 6 May 88 04:21:58 GMT References: <292@cullsj.UUCP> <696@fig.bbn.com> <4744@teddy.UUCP> <5198@umn-cs.cs.umn.edu> Reply-To: jerry@oliveb.UUCP (Jerry Aguirre) Organization: Olivetti ATC; Cupertino, Ca Lines: 30 In article <5198@umn-cs.cs.umn.edu> randy@umn-cs.UUCP (Randy Orrison) writes: >The ONLY problem I can see in doing this is if the news software that does >compression isn't smart enough to check if the result is larger than the >original. If it isn't smart enough, it should be. There's no excuse for >not checking that simple condition. Yes, there is an excuse. The "news software" in question is "sendbatch" which is just a shell script. (No, that is not the excuse.) It winds up doing a pipe of: batch batch_file | compress | uux bla!rnews Now compress is perfectly capable of telling you whether it's output was compressed or not. But in this case by the time it tells you the input is already gone! Doing this would require writing batch and compress output to files. Then you could decide what to send based on whether compress helped or not. If you are willing to put up with the extra overhead of creating temp files it is trivial to modify the script to compress only when effective. I guess that someone who was paying lots of money for the transmission line would find this worthwhile. Actually you could avoid the extra overhead. You have batch run the compress and check the exit status. Batch already checkpoints itself so it could re-create the batch if the compress failed. Compress writes the output to the same file system as /usr/spool/uucp and executes "uux" with the "-l" option so it makes a hard link to the file instead of copying it. You can then delete the original link to the temp file. All this starts to get a little non-portable.....