In support of pipes, this function closes the output side of a pipe (if any) using rembiobuf (see initio(io)). This function then tests for termination of the process. The output pipe is closed to allow the process to stop reading and processing data; therefore this function may be used only after all data has been output to the process. The best test for end-of-file from a process is termination of the process. The test is performed using kill(2); however, since some systems mistake zombies for live processes (usually in shopping malls), eof first creates a process using fork(2) and then waits for its termination using dezomb (see initio(io)), before running kill(2).
This function resets the current file.
This function implements the BASIC EOF function.
Error 54 (Bad file mode) is generated if the file is open for output only.
from The Basmark QuickBASIC Programmerís Manual by Lawrence Leinweber