f_rewind


Use this function to set the file position in the open target file to the start of the file.

Format

int f_rewind ( F_FILE * filehandle )

Arguments

Argument Description Type
filehandle The file handle.  F_FILE  *

Return values

Return value Description
F_NOERR Successful execution.
Else See Error Codes.

Example

 void myfunc()
{
    char buffer[4];
    char buffer2[4];
    F_FILE *file = f_open( "myfile.bin", "r" );
    if (file)
    {
        f_read( buffer, 4, 1, file );
        f_rewind( file );               /* Rewind file pointer */
        f_read( buffer2, 4, 1, file );  /* Read from beginning */
        f_close( file );
    }
    return 0;
}