Write contents to file on disk (sync buffer to file).
Creates backup if needed, writes to disk, and updates file metadata. This is used when the buffer already has the contents and we just need to sync it to the file. Unlike write(), this does not update the buffer contents.
| contents |
Contents to write |
| Error |
if file cannot be written |