file(WRITE): Report errors during write operation
We already report an error if the file cannot be opened for writing. Add another check to report an error if a write operation itself fails.
Edited by Brad King
We already report an error if the file cannot be opened for writing. Add another check to report an error if a write operation itself fails.