Checking If a File Exists : exist « File Directory « Ruby






Checking If a File Exists

puts "It exists!" if File.exist?("file1.txt")

 

Related examples in the same category

1.Create class to wrap File.exist and File.new method
2.Checking to See if a File Exists
3.Check to see if a dicectory exists