From: Justin Collins Date: 2008-02-09T09:46:40+09:00 Subject: Re: trouble with FileUtils.rm() -- Invalid arguement error an an wrote: > Justin Collins wrote: > >> an an wrote: >> >>>> It looks like you're trying to remove all the files in the directory at >>>> >>> dir = Dir.open("c:\\myDir\\delete\\") >>> FileUtils.rm(dir.entries.reject{|e| /\.{1,2}$/ =~ e}) >>> >>> the problem is, that the dir.entries only returns the filename of each >>> entry...is there anyway to have them expanded >>> >> Use Dir.glob instead: >> >> FileUtils.rm Dir.glob("c:\\myDir\\delete\\") >> >> -Justin >> > > still doesn't work for some reason. in irb if I do > > Dir.glob("C:\") > puts Dir.glob("C:\") > > neither of which print anything > > I forgot the asterisk: FileUtils.rm Dir.glob("c:\\myDir\\delete\\*") -Justin