More helpful error messages for file i/o.