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;
pxFile = f_open( "afile.bin", "r" );
if( pxFile != NULL )
{
f_read( pcBuffer1, 4, 1, pxFile );
f_rewind( pxFile );
f_read( pcBuffer2, 4, 1, pxFile );
f_close( pxFile );
}
}
Example use of the f_rewind() API function
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.