file_of_string : string -> string
Write out a string to a named file.
Given a filename fn and a string s, the call file_of_string fn s attempts
to open the file fn for writing and writes the string s to it before
closing. If the file exists, it will be overwritten, and otherwise a new file
will be created.
- FAILURE CONDITIONS
Fails if the file cannot be opened for writing.
will result in a file /tmp/hello containing the text:
# file_of_string "/tmp/hello" "Hello world\nGoodbye world";;
val it : unit = ()