int f_getc( F_FILE *pxFileHandle );
Reads a single byte from the current read/write position of an open FAT file. The current file
position is incremented by one.
A file can only be read if it was opened with one of the following
option strings: "r", "r+", "w+" or "a+" (see f_open()).
The handle of the file from which a character is being read.
The handle is returned by the call to f_open() used to
originally open the file.
A character was not read from the file.
Any other value
The character that was read from the file.
void vSampleFunction( char *pcFileName, char *pcBuffer, long lBufferSize )
pxFile = f_open( pcFileName, "r" );
for( lBytesRead = 0; lBytesRead < lBufferSize; lBytesRead++ )
iReturnedByte = f_getc( pxFile );
if( iReturnedByte == -1 )
pcBuffer[ lBytesRead ] = ( char ) iReturnedByte;
f_close( pxFile );
Example use of the f_getc() API function
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.