Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Homepage FreeRTOS+ Products FreeRTOS Labs Integration Services Contact / Enquiries

f_flush()

[FreeRTOS Embedded File System API]

header_file.h
unsigned char f_flush( F_FILE *pxFileHandle );
		

Ensure all the data that has been altered in a FAT file is comitted to the disk.

Parameters:

pxFileHandle   The handle of the file being flushed. The handle is returned by the call to f_open() used to originally open the file.

Returns:
F_NO_ERROR   All data associated with the file was comitted to the disk.

Any other value   The file could not be flushed. The return value holds the error code.

See also

f_read(), f_write(), f_open(), f_close().

Example usage:


void vSampleFunction( void )
{
F_FILE *pxFile;
char *pcString = "ABC";

    /* Open the file afile.bin for writing. */
    pxFile = f_open( "afile.bin","w" );
    if( pxFile != NULL )
    {
        /* Write three bytes to the opened file. */
        f_write( pcString, strlen( pcString ), 1, pxFile );

        /* Flush the file to ensure the data is commited before continuing. */
        f_flush( pxFile );

        /*
         * Other file accesses can occur here before the file is evenutally
         * closed using a call to f_close().
         */
    }
}
						
Example use of the f_flush() API function


[ Back to the top ]    [ About FreeRTOS ]    [ FreeRTOS+ Sitemap ]    [ Main FreeRTOS Sitemap ]    [ ]


Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.