From: Dave Brondsema Date: 2000-12-09T13:40:06+09:00 Subject: [ruby-talk:6949] Dir.sort(somedir) ? I just started experimenting with Ruby tonight and have written a decent sized program in just a few hours. I have a question though. I currently do a loop through all the files in a directory using the following (I like Ruby's iterators, btw): Dir.foreach(thisdir) { |filename| # do stuff with filename } How can I change this so that it iterates through the alphabetically sorted directory? If I could get the directory into an array, I think I could sort it using arrayname.sort and then iterate through it. However, I don't even know how to do that. Thanks in advance, -- Dave Brondsema Sent via Deja.com http://www.deja.com/ Before you buy.