Ruby experts:

I know how to read each file in a subdirectory using the code below. My question is: How can this code be modified so that the code will, in addition, read each file in all subdirectories below "some_directory"?

(I think what I want is a way to read all subdirectories "recursively".)

Thanks in advance!

Kurt Euler



Dir.new("./some_directory").each { |fname|
	if (File.file? "./some_directory/"+fname)
		File.open("./some_directory/"+fname) { |file|
			do_stuff_here
		}
	end
}