Returns true if the file pointer is at the end of a file previously opened with create( ) or open( )

Syntax

<oRef>.eof( )

<oRef>

A reference to the File object that created or opened the file.

Property of

File

Description

eof( ) determines if the file pointer of the file you specify is at the end of the file (EOF), and returns true if it is and false if it is not. The file pointer is considered to be at EOF if it is positioned at the byte after the last character in the file.

You can move the file pointer to the end of the file with seek( ). If a file is empty, as it is when you first create a new file with create( ), eof( ) returns true.