Dir.foreach « File Directory « Ruby






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