Product Information > JADE Error Messages and System Messages > 5000 through 5099 - File Handling Errors > 5009 - Cannot read past the end of file

5009   Cannot read past the end of file

Cause

This error occurs if there is an attempt to read beyond the end of a file. If the file was at the end before the read, no data will have been read. If the file was not at the end before the read, data up to the end of the file will have been read.

Action

Change your application code so that it does not attempt to read past the end of the file. Do this by checking for end-of-file before reading and by ensuring that you do not attempt to read records larger than the difference between the length of the file and the current file offset.