Write contents to buffer and file.
Updates buffer contents and writes to file on disk. For files in database, creates backup before writing.
Contents to write
if file cannot be written