From: Fleck Jean-Julien Date: 2010-01-08T06:47:46+09:00 Subject: Re: Setting recursion depth Hello, > 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 Something like Dir.glob(['*','*/*','*/*/*','*/*/*/*']) should do without being too "manual" Or if you like to change the depth: def search_to_depth(n) array = Array.new(n) {|i| '*' + '/*'*i} Dir.glob(array) end Cheers, -- JJ Fleck PCSI1 Lycée Kléber