f_tell
Use this function to obtain the current read-write position in the open target file.
Format
long f_tell ( F_FILE * filehandle )
Arguments
Argument | Description | Type |
---|---|---|
filehandle | The file handle. | F_FILE * |
Return values
Return value | Description |
---|---|
filepos | The current read or write file position. |
Else | See Error Codes. |
Example
int myreadfunc( char *filename, char *buffer, long buffsize )
{
F_FILE *file = f_open( filename, "r" );
printf( "Current position %d", f_tell( file ) );
f_read( buffer, 1, 1, file ); /* Read one byte */
printf( "Current position %d", f_tell( file ) );
f_read( buffer, 1, 1, file ); /* Read one byte */
printf( "Current position %d", f_tell( file ) );
f_close( file );
return 0;
}