f_eof


Use this function to check whether the current position in the open target file is the end of the file.

Format

int f_eof ( F_FILE * filehandle )

Arguments

Argument Description Type
filehandle The file handle. F_FILE *

Return values

Return value Description
0 Not at the end of the file.
Else End of file or an error; see Error Codes.

Example

int myreadfunc( char *filename, char *buffer, long buffsize )
{
    F_FILE *file = f_open( filename, "r" );
    while (!f_eof())
    {
        if (!buffsize) break;
        buffsize--;
        f_read( buffer++, 1, 1, file );
    }
    f_close( file );
    return 0;
}