From: "Iñaki Baz Castillo" Date: 2010-01-08T05:57:50+09:00 Subject: Re: Setting recursion depth El Jueves, 7 de Enero de 2010, Stuart Clarke escribió: > Hi all, > > I have done some Googling regarding setting the depth of recursive > search in a ruby script and all I have identified is File-Find. Is this > all that can help me? > > Basically I want to be able to specify the depth my script will work so > if the depth is 4, the script will look at all items from the root to 4 > folders deep e.g > > Root > Folder 1 > Folder 2 > Folder 3 > > Any input is much appreciated. I cannot imagine a "cool" way. Perhaps listing all the files in current directory (File.dirname(__FILE)) and then inspecting each of them with File.directory?(file). In case of "true" then inspect the content of that directory and repeat the operation (until depth is 4). Yes, a bit manual though... :) -- Iñaki Baz Castillo