FreeRTOS+FAT is still in the lab
FreeRTOS+FAT is already in use in commercial products
and we encourage you to try it yourself. Be aware however that
FreeRTOS+FAT was acquired by Real Time Engineers Ltd., and is
still being documented and updated to
ensure it meets our strict quality standards.
Please use the forum for support,
or contact us directly if you have a specific business interest.
int ff_fputc( int iChar, FF_FILE * pxStream );
Write a single byte to an open file in the embedded FAT file system.
The read/write position is incremented by one.
Passing a char in an int may not seem optimal, but the ff_fputc()
prototype conforms to the standand and expected stdio fputc() function prototype.
The value written to the file. The value is converted
to an unsigned char (8-bit) before it is written.
A pointer to the file to which the character is being written.
This is the same pointer that was returned from the call
to ff_fopen() used to originally open the file.
On success the byte written to the file is returned. If any other value
is returned then the byte was not written to the file and the task's
errno will be set to indicate the reason. A task
can obtain its errno value using the ff_errno()
void vSampleFunction( char *pcFileName, int32_t lNumberToWrite )
const int iCharToWrite = 'A';
pxFile = ff_fopen( pcFileName, "w" );
for( lBytesWritten = 0; lBytesWritten < lNumberToWrite; lBytesWritten++ )
iCharWritten = ff_fputc( iCharToWrite, pxFile );
if( iCharWritten != iCharToWrite )
ff_fclose( pxFile );
Example use of the ff_fputc() API function