with Dir's foreach : Dir.foreach « File Directory « Ruby






with Dir's foreach


Dir.foreach( "/usr/local/src/ruby-1.8.6" ) { |e| puts e }

 

Related examples in the same category

1.Dir.entries returns an array with all the entries within the specified directory. Dir.foreach provides the same feature, but as an iterator: