File.file?( "yourFile.txt" ) # => true
# tests whether a file exists before opening it File::open("file.rb") if File::exists?( "file.rb" )