Re: exclusion in file patterns
Tim Hemel <[email protected]>
| Newsgroups | gmane.comp.tools.aap.devel |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Sep 12, 2003 at 12:35:47PM +0200, Bram Moolenaar wrote:
>
> Tim Hemel wrote:
> It would be possible to abandon the use of ":tree" and add a tree()
> function instead. For executing commands on a selection of files you
> would then do:
>
> @for name in tree(...):
> :do your thing
>
> Hmm, that's actually quite nice. Would it be worth inventing a tree()
> function for this reason?
It would definitely solve my recursive file selection, except for the
exclusion, but for that you could use another operator ('-' ?).
FILES= `tree("www") - tree("CVS") - tree("*.bak")`
But then we have another problem, what is meant by *.bak? Just the .bak files
in the current directory, or everything that end in .bak ?
I would suggest calling tree something like rglob (recursive glob), if its
arguments are going to include wildcards.
Too bad that the - operator is not defined for lists in Python, but we can
probably overload it.
The rglob/tree function definitely is useful, I think.
> "Software is like sex... it's better when it's free."
> -- Linus Torvalds, initiator of the free Linux OS
> Makes me wonder what FSF stands for...?
Where can I sign up?
Tim
--
Zen Microsystems: we're the om in .commmmmmmmm...
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf