help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] allFilesMatching:do:


From: Paolo Bonzini
Subject: Re: [Help-smalltalk] allFilesMatching:do:
Date: Mon, 19 Jan 2009 17:46:58 +0100
User-agent: Thunderbird 2.0.0.19 (Macintosh/20081209)

>  ( File name: '/top' ) all namesDo: [ :e | ( File stripPathFrom: e ) ]
> 
> I think the more common use case is the latter.... Let me know what you
> think, I can either send over the patch as it exists now or I can change
> it so that allFilesMatching and companions work on names with the paths
> completely stripped off...

I agree that this is the common use case.  You can also change it to
prepend (?:^|/) to the regex; it's probably faster than stripping the path.

> If I expanded out to use stripPathFrom when selecting what to match, I
> would make sure to still return full relative path from filesMatching:

Of course.  The names passed to the block by #namesMatching:do: should
also not be affected.

> Sorry this was so long. Just trying to be complete.

No problem.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]