You added this function, but it is not exported?

Also, you can do `file:write_file(Filename, FormattedTerm, [append])` instead of the open/write/close dance.