Use record-based I/O.
Check output errors
