Use non-empty file in checkwrite. Improve checkwrite messages.
Merge pull request #4171 from AndresTanasijczuk/checkwrite

Use non-empty file in checkwrite. Improve checkwrite messages.