From: nobu.nokada@... Date: 2002-06-26T00:59:52+09:00 Subject: Re: rm -rf Hi, At Tue, 25 Jun 2002 23:34:40 +0900, Bil Kleb wrote: > > I'm curious, rm -rf will just as well work for a GNU/Linux box, so I guess > > you don't simply want to execute this as a shell command from your Ruby > > script with `rm -rf `? > > Right, for some reason I'm against using system or back ticks today. dirs = [] Dir.glob("#{path}/**/{.[^.],..?,}*") do |f| if File.directory?(f) dirs << f else File.unlink(f) end end dirs.reverse_each(&Dir.method(:rmdir)) -- Nobu Nakada