1.2.7.4.11 SYS_FS_FileTell Function

1.2.7.4.11 C

int32_t SYS_FS_FileTell
(
    SYS_FS_HANDLE handle
);

1.2.7.4.11 Summary

Obtains the file pointer position.

1.2.7.4.11 Description

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

1.2.7.4.11 Precondition

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

1.2.7.4.11 Parameters

ParametersDescription
handleFile handle obtained during file Open

1.2.7.4.11 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.

1.2.7.4.11 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
}

1.2.7.4.11 Remarks

None.