From: Tim Hunter Date: 2008-02-08T11:56:34+09:00 Subject: Re: trouble with FileUtils.rm() -- Invalid arguement error an an wrote: > I have been screwing with this for the last hour, and I still cant get > it (so frustrating when you get stuck on matters that seem trivial). > > I am trying to delete all the contents from the temporary internet files > in vista, and I keep getting an invalid argeument error. > > cache_dir = ENV['USERPROFILE'] + > "\\AppData\\Local\\Microsoft\\Windows\\Temporary Internet Files\\*.*" > > FileUtils.rm(cache_dir) > > I have tried several different variations, of backtick, single quotes, > double quotes, etc, etc....even tried deleting a single file, and it > always gives me the same error. Also tried rm_r, rm_rf...still no luck. > > could someone explain to me what I am doing wrong? thanks! It looks like you're trying to remove all the files in the directory at once. Bear in mind that FileUtils.rm wants a _list_ of filenames, not a pattern to match. You can specify a list of filenames by accumulating them in an array and then using the splat operator: filenames = whatever it takes to get all the filename in an array FileUtils.rm(*filenames) -- RMagick: http://rmagick.rubyforge.org/ RMagick 2: http://rmagick.rubyforge.org/rmagick2.html