|
IDL Reference Guide: Procedures and Functions |
|
The EOF function tests the specified file unit for the end-of-file condition.
| Note The EOF function cannot be used with files opened with the RAWIO keyword to the OPEN routines. Many of the devices commonly used with RAWIO signal their end-of-file by returning a zero transfer count to the I/O operation that encounters the end-of-file. |
Result = EOF(Unit)
If the file pointer is positioned at the end of the file, EOF returns true (1), otherwise false (0) is returned.
The file unit to test for end-of-file.
None.
If file unit number 1 is open, the end-of-file condition can be checked by examining the value of the expression EOF(1). For example, the following IDL code reads and prints a text file: