From: AW Date: 2002-12-14T07:53:03+09:00 Subject: Re: need advice for parsing directories .ftp. Thank you very much! Thats an excellent example of what I was trying to accomplish. Much more elegant that what I was going to do! Thanks again! Aaron. >I've always liked recursion. I just threw this together. Forgive me if >it doesn't work perfectly. It's a five minute throw together... > ># doesn't handle dotfiles... >def drecurse(dirname) > Dir.open(dirname) do |dir| > dir.each do |file| > if test(?d, "#{dirname}/#{file}") > next if file =~ /^\./ > puts "dir - #{dirname}/#{file}" > drecurse("#{dirname}/#{file}") > else > # Do something with file > end > end > end >end > >drecurse(".") >