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

f_rewind()

[FreeRTOS Embedded File System API]

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

Sets the current read/write position of an open FAT file back to the start of the file.

Parameters:

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

Returns:
F_NO_ERROR   The file was reset.

Any other value   An error occurred. The returned value holds the error code.

See also

f_seek(), f_tell().

Example usage:


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

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

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

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

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

        /* Finished with the file. */
        f_close( pxFile );
    }
}
						
Example use of the f_rewind() 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.