The File module provides an exists?/1 to check if a file exists.

true  = File.exists?("exists.txt")
false = File.exists?("doesnt_exist.txt")