header_file.h
unsigned char f_eof( F_FILE *pxFileHandle );
Determine if the current read/write position in an open FAT file is the end
of the file.
Parameters:
pxFileHandle
|
The handle of the file being queried. The handle is
returned by the call to f_open() used to originally open
the file.
|
Returns:
0
|
The current file read/write position is not at the end of
the file.
|
Any other value
|
The current file read/write position is at the end of the
file, or an error occurred.
|
See also
f_write(), f_read().
Example usage:
long lSampleFunction ( const char *pcFileName, char *pcBuffer, long lBufferSize )
{
F_FILE *pxFile;
long lWritePosition = 0;
pxFile = f_open( pcFileName, "r" );
while( f_eof( pxFile ) == 0 )
{
if( lWritePosition < lBufferSize )
{
f_read( &( pcBuffer[ lWritePosition ] ), 1, 1, pxFile );
lWritePosition++;
}
else
{
break;
}
}
f_close( pxFile );
return lWritePosition;
}
Example use of the f_eof() API function
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.