It returns false when it didn't reach the end of file.
Let me give you an example:
We have a 4-byte example file.
We will read 2-byte "packets".
1. Read and Store Data. read returns a nonzero value. 2/4 bytes read.
2. eof() returns false. eof flag isn't set.
3. Read and Store Data. read returns a nonzero value. 4/4 bytes read.
4. eof() returns false. eof flag isn't set.
5. Read and Store Data. read returns a zero value. Cannot go over 4/4, eof flag set.
6. eof() returns true as the eof flag is set.