Download FreeRTOS

Quality RTOS & Embedded Software

FreeRTOS website now available in Simplified Chinese
New FreeRTOS Long Term Support version now available.
FreeRTOS Extended Maintenance Program (EMP) registration now open.
FreeRTOS-Plus-TCP v3.0.0 released:
Featured FreeRTOS IoT Integrations:


[FreeRTOS-Plus-FAT Standard API Reference]

void ff_rewind( FF_FILE *pxStream );

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

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


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

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.