From: Mark Bush Date: 2008-03-14T18:02:07+09:00 Subject: Re: check if file exists for part of the filename Christian Kerth wrote: > I only want to know if a file exists, that starts with "file_" Dir.entries('.').detect {|f| f.match /^file_/} Replace '.' with the name of the directory to check if it is not the current directory. Will return the name of the first file to match if there is one, else will return nil. -- Posted via http://www.ruby-forum.com/.