eof

Determines if the end of the file has been reached for a specified file.

Library:LibC
Classification:Other
Service:File and Directory I/O

Syntax

  #include <fsio.h> 
   
  int eof (
     int   fildes);
  

Parameters

fildes

(IN) Specifies a file descriptor.

Return Values

Returns one of the following:

Decimal

Constant

Description

4

EBADF

The fildes parameter isn't a valid file descriptor.

Remarks

The eof function determines if the end of the file has been reached for the file whose file descriptor is given by the fildes parameter. Because the current file position is set following an input operation, eof can be called to detect the end of the file before an input operation beyond the end of the file is attempted.

See Also

dup