Dir.entries contains all the entries found in a directory : Dir.entries « File Directory « Ruby






Dir.entries contains all the entries found in a directory


# including files, hidden files, and other directories, one array element per entry. 

# I'll apply Array's each method to the output of entries:

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

 








Related examples in the same category

1.get a list of the files and directories within a specific directory using Dir.entries:
2.Listing A Directory