Email Focus
Mike Touloumtzis
miket@bluemug.com
Mon Dec 10 20:53:01 2001
On Mon, Dec 10, 2001 at 02:34:12PM -0500, Frank Tobin wrote:
> Mike Touloumtzis, at 11:07 -0800 on 2001-12-10, wrote:
>
> > Incorporating unrelated functionality like recursion is a symptom of
> > a weak command line environment. The recursive 'find' command line I
> > posted here earlier isn't a hackish workaround, it's a best practice.
>
> Not necessarily. Your find example executes gpg on each file in the tree;
> however, you've just increased the cost of computation by
> n*(GnuPG-startup+shutdown) time.
Well, life is hard :-).
Seriously, there are lots of microoptimizations you could make to the Unix
command line. 'ls' would be faster if it were integrated into the shell.
The question is: are people willing to give up cleanliness for speed? I
don't think most tree walking operations are performance critical.
> Stretching your argument a bit further, I could argue that 'cp' shouldn't
> take multiple source arguments, which is kind of silly. There is a
> balance between ease of use, performance, and 'cleanness' that needs to be
> struck.
Multiple arguments != recursive behavior, at least in terms of tradition.
Lots of questions come up with recursive behavior that just aren't
there for simpler cases. Do you follow symlinks? Do you cross device
boundaries? How do you exclude that big 'cache' directory which you
don't want to encrypt?
I _do_ think gnupg should be able to encrypt multiple files in one
invocation, which it doesn't seem to be able to do now. That way, if you
want to amortize startup time for a tree walk which really is performace
critical, you can pipe find's output to 'xargs -n <large number> gpg'.
> > Which is better, to have every random tool implement recursive
> > functionality in mutually incompatible ways, or to have a few general
> > purpose tree walking tools like 'find', which you can use to make any
> > tool recursive?
>
> Your general-purpose-tree-walking tool maybe should be a library call, so
> that minimal work need be done to implement recusive application.
man 3 ftw
man 3 nftw
Lack of library support isn't to blame :-).
miket