int f_putc( int iChar, F_FILE *pxFileHandle );
Writes a single character into an open FAT file. The data is written at
the current file read/write position, and the current file read/write position is incremented
A file can only be written to if it was opened with one of the following
option strings: "w", "w+", "a+", "r+" or "a" (see f_open()).
The character to be written to the file.
The int data type is not appropriate to hold a character
but is used to comply with the expected standard file
The handle of the file to which the character is being written.
The handle is returned by the call to f_open() used to
originally open the file.
The character being written
The character was successfully written to the file.
Any other value
The character was not successfully written to the file.
void vSampleFunction( char *pcFileName, long lNumberToWrite )
const int iCharToWrite = 'A';
pxFile = f_open( pcFileName, "w" );
for( lBytesWritten = 0; lBytesWritten < lNumberToWrite; lBytesWritten++ )
iCharWritten = f_putc( iCharToWrite, pxFile );
if( iCharWritten != iCharToWrite )
f_close( pxFile );
Example use of the f_putc() API function
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.