Detecting End of File

IDL_FileEOF()

The IDL_FileEOF() function returns TRUE if the file specified by the Logical Unit Number unit is at EOF, and FALSE otherwise:

int IDL_FileEOF(int unit) 

unit

The Logical Unit Number (LUN) of the file in question.