Write a string to file Mar 14, 2016 This example shows how to write to a file using File.write. :ok = File.write("example.txt","Hello File!") # Error tuple for failure {:error, reason} = File.write("example.txt","Hello File!") # write!/3 Raises exception :ok = File.write!("example2.txt","Hello File!") Documentation: File.write/3