Hal E. Fulton
7/25/2006 6:03:00 AM
Alexander Lamb wrote:
> Hello,
>
> I am doing something like this:
>
> Find.find("/Users/alamb/_Current-Work/fiches") do |path|
> if(path =~ /100_/)
> ...
>
> In order to get all the files of the directory which have "100_" in the
> name.
>
> Two questions:
>
> 1) Is there a way to use the find method to directly achieve this?
> 2) I tried a Regexp with /^100_/ to say "files starting with '100_' "
> but it doensn't seem to work.
I don't usually use Find... Dir is fairly powerful.
Dir["100*"] # all 100-type files in current dir
Dir["**/100*"] # all in this tree (correct syntax??)
Hal