From: Robert Klemme Date: 2010-08-24T16:10:45+09:00 Subject: Re: Looking for a file somewhere in a directory recursively 2010/8/23 Ralph Shnelvar : > Robert, > > Monday, August 23, 2010, 9:25:56 AM, you wrote: > > RK> For the pattern above you only need > > RK> batches = Dir['MyDir/*.bat'] > > RK> or if you want to get fancy: > > RK> batches = Dir[File.join('MyDir', '*.bat')] > > RK> For the fully recursive version you can do > > RK> batches = Dir['MyDir/**/*.bat'] > > RK> and be done.  No Gems required.  You can even do > > RK> batches = Dir['MyDir/**/*.{bat,cmd}'] > > RK> and really get all Windows batch files. > > Is the stuff, above, some sort of 1.9 syntax?  Do you really mean square brackets? No. Yes. > On 1.8 ... I cannot get anything you wrote, about, to work. Please show your IRB session / code and the errors you got. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/