[24079] trunk/base/src/pextlib1.0/find.c

Jordan K. Hubbard jkh at brierdr.com
Mon Apr 16 01:15:08 PDT 2007

On Apr 15, 2007, at 10:44 PM, source_changes at macosforge.org wrote:
> Rewrite Pextlib find command. Now actually has useful API. Usage is  
> find ?-depth? ?-ignoreErrors? target ?target ...? varname body. - 
> depth identical to -d switch to find. -ignoreErrors causes it to  
> ignore permission/read errors. Does not follow symlinks.

I'm not sure I exactly agree with that statement.   First, the usage  
statement is a little confusing - can you cite some actually usage  

Second, you've forced the execution of the body every time, and that  
was not the original intention of this API.  The original intention  
was to have an Expr evaluated as a predicate and ONLY execute the body  
if the expr matched, allowing you to separate the "work statements"  
from the "match statements" - now you have to write a conditional into  
every body instead and it doesn't read as well.  The fact that many  
people used find with an expr of "1" is besides the point - you could  
just as easily match against a specific filename regexp, or file type,  
or whatever.  Just as find(1) has a whole bunch of predicates which  
precede -exec, so this command was intended to give you one complex  
predicate (with all the usual boolean operators) and the equivalent of  
"-exec" in the body.

I'm having a hard time seeing this as anything but a regression, so  
perhaps you could explain your rewrite to the original author, at  
least? :-)

- Jordan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-dev/attachments/20070416/2b5c4fd3/attachment.html

More information about the macports-dev mailing list