Problem with compress

Andreas Stolcke stolcke at ICSI.Berkeley.EDU
Wed May 15 13:18:18 AEST 1991


In article <26085:May1416:52:3491 at kramden.acf.nyu.edu>, brnstnd at kramden.acf.nyu.edu (Dan Bernstein) writes:
|> (I'm not sure whether this is appropriate for comp.compression.)
|> 
|> In article <1991May14.044431.23932 at sparky.IMD.Sterling.COM> kent at sparky.IMD.Sterling.COM (Kent Landfield) writes:
|> > I received an interesting question today, one I had never really considered.
|> > "How does compress deal with symbolic links ?"
|> 
|> compress isn't a BSD program. It uses stat(), and its behavior makes
|> perfect sense.
|> 
|> I think compressors should ignore problems like this. They shouldn't
|> open files, they shouldn't close files, they shouldn't do anything but
|> read data and write compressed data. This also makes them more portable.
|> A separate, system-dependent program can do the dirty work.

It so happens that there is such a command that I think is fairly widely
available (if not it should be).  It is called compressdir and recursively
traverses a directory tree attempting to compress every plain file it
finds.  I it picked up as part of the TeX distribution, a copy is 
appended.  There is a also a companion script called uncompressdir.

-- 
Andreas Stolcke					stolcke at icsi.berkeley.edu
International Computer Science Institute	stolcke at ucbicsi.bitnet
1957 Center St., Suite 600, Berkeley, CA 94704	(415) 642-4274 ext. 126
---
OPTIONS=
FILES=
for ARG
do
        case "$ARG" in
        -*)     OPTIONS="$OPTIONS $ARG";;
        *)      FILES="$FILES $ARG";;
        esac
done
if test -z "$FILES"; then
        FILES="."
fi
set $FILES
find $@ -type f -links 1 -exec test -r {} -a -s {} \; \
-exec expr '(' {} : '.*\.Z' ')' '=' 0 \; \
-exec compress $OPTIONS {} \; >/dev/null



More information about the Comp.sources.bugs mailing list