Article View: comp.sources.bugs
Article #646Re: Problem with compress
From: Andreas Stolcke
Date: Wed, 15 May 1991 03:18
Date: Wed, 15 May 1991 03:18
42 lines
2400 bytes
2400 bytes
In article <26085:May1416:52:3491@kramden.acf.nyu.edu>, brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes:
|> (I'm not sure whether this is appropriate for comp.compression.)
|>
|> In article <1991May14.044431.23932@sparky.IMD.Sterling.COM> kent@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@icsi.berkeley.edu
International Computer Science Institute stolcke@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
Technical Details
Message-ID:
<1991May15.031818.6182@agate.berkeley.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!agate!ICSI.Berkeley.EDU!stolckeReferences:
<1991May14.044431.23932@sparky.IMD.Sterling.COM> <26085: May1416:52:3491@kramden.acf.nyu.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!agate!ICSI.Berkeley.EDU!stolcke From: stolcke@ICSI.Berkeley.EDU (Andreas Stolcke) Newsgroups: comp.sources.bugs,comp.compression Subject: Re: Problem with compress Summary: compressdir is the answer Message-ID: <1991May15.031818.6182@agate.berkeley.edu> Date: 15 May 91 03:18:18 GMT References: <1991May14.044431.23932@sparky.IMD.Sterling.COM> <26085: May1416:52:3491@kramden.acf.nyu.edu> Sender: root@agate.berkeley.edu (Charlie Root) Organization: International Computer Science Institute, Berkeley, CA Lines: 42