On Thu, 2004-10-07 at 12:30, Michael Weller wrote: > Hi! > I wrote this code to walk a file tree from a given starting directory: > > def each_dir(start_dir, &action) puts "start_dir: #{start_dir}" > files = Dir.new(start_dir).to_a[2..-1] #remove . and .. # Above line will throw an exception #if start_dir is not a Directory > files.each do |f| > unless File.file? f then > yield f > each_dir(start_dir << "\\" << f, &action) > end > end > end > > But this doesn't work properly because it seems like File.file? > sometimes errs... > I know RTFS ;-) but I couldn't find it :-(( > Can someone guide me? > > Michael RTFS ... lol -- Mohammad Khan <mkhan / lextranet.com> Legal Computer Solutions, Inc.