[ ]
 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Homepage FreeRTOS Labs FreeRTOS+TCP FreeRTOS+FAT Contact / Enquiries


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.

ff_rewind()

[FreeRTOS+FAT Standard API Reference]

ff_stdio.h
void ff_rewind( FF_FILE *pxStream );
		

Moves the current read/write position back to the start of a file.

Calling...
ff_rewind( pxStream );

...is equivalent to calling
( void ) ff_fseek( pxStream, 0, FF_SEEK_SET );.

Parameters:

pxStream   The file in which the current read/write position is being set back to the start of the file.

Example usage:


void vSampleFunction( void )
{
char pcBuffer1[ 4 ], pcBuffer2[ 4 ];
FF_FILE *pxFile;

    /* Open the file "afile.bin". */
    pxFile = ff_fopen( "afile.bin", "r" );

    if( pxFile != NULL )
    {
        /* Read four bytes into pcBuffer1. */
        ff_fread( pcBuffer1, 4, 1, pxFile );

        /* Set the current read pointer back to the start of the file. */
        ff_rewind( pxFile );

        /* Read the same four bytes into pcBuffer2. */
        ff_fread( pcBuffer2, 4, 1, pxFile );

        /* Finished with the file. */
        ff_fclose( pxFile );
    }
}
						
Example use of the ff_rewind() API function


[ Back to the top ]    [ About FreeRTOS ]    [ FreeRTOS Labs 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.