From: rio4ruby Date: 2007-09-05T07:05:07+09:00 Subject: Re: Why does File.exists? not support regexp? It would be very handfull? On Sep 4, 8:43 am, kazaam wrote: > Hi, > if I wanna check if a file exists like fglrx.i386.8.40.3.ko why is File.exists? not able to handle regexp to check this like: > > system('rm fglrx*') if File.exists?(/^fglrx.+/) > > --> ./test.rb:4:in `exists?': can't convert Regexp into String (TypeError) > > -- > kazaam I agree that file matching via regular expressions is very convenient in certain situations that are not handled by globs. You might want to look at Rio (http://rio.rubyforge.org).