1.2.7.4.11 SYS_FS_FileTell Function

C

int32_t SYS_FS_FileTell
(
    SYS_FS_HANDLE handle
);

Summary

Obtains the file pointer position.

Description

Obtains the current value of the file position indicator for the file pointed to by handle.

Precondition

A valid file handle must be obtained before performing a file tell.

Parameters

ParamDescription
handleFile handle obtained during file Open.

Returns

On success - returns the current file position.

On failure - returns -1. The reason for the failure can be retrieved with SYS_FS_Error or SYS_FS_FileError.

Example

SYS_FS_HANDLE fileHandle;
int32_t tell;

fileHandle = SYS_FS_FileOpen("/mnt/myDrive/FILE.JPG", (SYS_FS_FILE_OPEN_READ));

if(fileHandle != SYS_FS_HANDLE_INVALID)
{
    // File open is successful
}
...
...

tell = SYS_FS_FileTell(fileHandle);

if(tell != -1)
{
    // Success
}

Remarks

None.