int ff_feof( FF_FILE *pxStream );
Queries an open file in the embedded FAT file system to see if the file's
read/write pointer is at the end of the file.
The file being queried. The file must have first been opened
using a call to ff_fopen().
If the file's read/write pointer is at the end of the file then
a non-zero value is returned.
If the file's read/write pointer is not at the end of the file, and no
errors occur, then zero is returned and the task's errno is also set to
If an error prevents the function from determining the position of the
file's read/write pointer then zero is returned and the task's errno is
set to indicate the reason.
A task can obtain its errno value using the stdioGET_ERRNO
void vSampleFunction( char *pcFileName, char *pcBuffer, int32_t lBufferSize )
pxFile = ff_fopen( pcFileName, "r" );
for( lBytesRead = 0; lBytesRead < lBufferSize; lBytesRead++ )
if( ff_feof( pxFile ) != 0 )
iReturnedByte = ff_fgetc( pxFile );
pcBuffer[ lBytesRead ] = ( char ) iReturnedByte;
ff_fclose( pxFile );
Example use of the ff_feof() API function
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.