From: Jens Riedel Date: 2005-05-12T19:40:28+09:00 Subject: Go through directories recursively Hello, I'm quite new to Ruby. I'd to walk through a directory tree and edit all jsp files in there. I do it this way: def editDirectory(path) Dir.entries(path).each { |filename| next if filename =~ /^\.+$/ currFile = path + "/" + filename if(File.stat(currFile).directory?) editDirectory(currFile) elsif(filename =~ /(.+)\.jsp$/) # ... do something with the file end } end I'd like to know if there is a more professional or more "ruby-like" way to do this... Thanx for every hint, Jens