> Cannot write to myfile.out, file does not have write permissions
> Fix with: chmod +w myfile.out
I actually much prefer:
"can't write myfile.out: Permission denied"
This shows the same information as the first 2 lines combined from the example, and the 3rd line is not necessarily the correct way to fix the problem anyway (e.g. you might be running it as your user when it should be root, chmod +w would not help).
If you are so convinced that chmod +w is the way to fix the problem, why not just do that and carry on without bugging the user?
And having each error confined to one line also means it's much less likely that some of the lines are missed, e.g. when grepping a log.
EDIT: And to add to this: it's sometimes useful to prefix the error messages with the name of the program that generated them, so that when you're looking at a combined log from different places, you know which of the programs actually wrote the error, e.g. "mycli: can't write myfile.out: Permission denied".