Writes all of contents to a file named filename, with good error checking.
If a file called filename already exists it will be overwritten.
This write is atomic in the sense that it is first written to a temporary file which is then renamed to the final name. Notes:
If the call was sucessful, it returns TRUE. If the call was not successful, it returns FALSE and sets error. The error domain is G_FILE_ERROR. Possible error codes are those in the GFileError enumeration.
Note that the name for the temporary file is constructed by appending up to 7 characters to filename.
| filename | name of a file to write contents to, in the GLib file name encoding |
| contents | string to write to the file |
| length | length of contents, or -1 if contents is a nul-terminated string |
| error | return location for a GError, or NULL |
| TRUE on success, FALSE if an error occurred |