header_file.h
long f_tell( F_FILE *pxFileHandle );
Return the current read/write position of an open file in the FAT file system.
Parameters:
pxFileHandle
|
The handle of the file being queried. The handle is
returned from the call to f_open() used to originally
open the file.
|
Returns:
-1
|
F_FS_THREAD_AWARE is set to 1 and a file system
lock could not be obtained before F_MAX_LOCK_WAIT_TICKS
elapsed.
|
Any other value.
|
The returned value is the current read/write position
within the open file.
|
See also
f_seek()
Example usage:
void vSampleFunction( char *pcFileName, char *pcBuffer )
{
F_FILE *pxFile;
long lPosition;
pxFile = f_open( pcFileName, "r" );
lPosition = f_tell( pxFile );
f_read( pcBuffer, 1, 1, pxFile );
lPosition = f_tell( pxFile );
f_read( pcBuffer, 1, 1, pxFile );
lPosition = f_tell( pxFile );
f_close( pxFile );
}
Example use of the f_tell() API function
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.