> paths.map{|path| File.join(path, filename)}.select{|name| File.exist?(path)}

Of course, I meant to use name, instead of path in the last section. So:

file = paths.map{|path| File.join(path, filename)}.select{|name|
File.exist?(name)}

-- 
Anurag Priyam
http://about.me/yeban/