From: Kev Jackson Date: 2005-11-21T13:07:37+09:00 Subject: Re: Dir wes.monk@gmail.com wrote: >Dir.foreach("c:/wes/photos/Bike/*.JPG") {|x| puts "Got#{x}" } > >This does not seem to work on my windows xp machine? Should it? I am >trying to get a list of files with the .JPG extension. > >If I take the *.JPG out, I get a list of all of the files in that >directory? What am I doing wrong? I just want the .JPG's. > >Thanks in advance, > >wes > > > > Dir.foreach("c:/wes/photos/Bike/") { |x| p "got #{x}" if x[x.length-3, x.length]=='JPG' } I'm sure there's a better way, but this should do the trick Kev