write_file(
filename,text) ->ok,err
Write text content to a file
Opens path for writing (mode "w+"), which creates the file if it does
not exist and truncates it if it does. Writes text and closes the file.
Returns true on success, or nil and an error string on failure.
It does not sync. A crash or a power loss can leave the file empty or
short, with the old bytes already gone. A file whose loss costs more than
a rewrite goes through replace.