fs_fsetpos()

int  fs_fsetpos (FS_FILE    *p_file,
                 fs_fpos_t  *p_pos);

File

Called from

Code enabled by

fs_api.c

Application

FS_CFG_API_EN

Set file position indicator.

Arguments

p_file

Pointer to a file.

p_pos

Pointer to variable containing file position indicator.

Returned Value

0, if the function succeeds.

Non-zero value, otherwise.

Notes/Warnings

  1. The return value should be tested against 0:

    rtn = fs_fsetpos(pfile, &pos);
    if (rtn == 0) {
        // No error occurred
    } else {
        // Handle error
    }
  2. If a read or write error occurs, the error indicator shall be set.
  3. The value stored in pos should be the value from an earlier call to fs_fgetpos(). No attempt is made to verify that the value in pos was obtained by a call to fs_fgetpos().
  4. See also fs_fseek().