Please enable JavaScript to view this site.

This function is used to move the read/write pointer within a file.

Syntax

i32 f_seek (i32 offset, i32 mode, stru_filehnd stru)

offset

Defines the position of the pointer within the file.

The value provided by offset is interpreted by the operating system appropriately, depending on the specified mode parameter

mode

Is a constant that specifies how the offset parameter value is interpreted.

Allowed values are as follows:

Value

Meaning

0

Absolute position from the beginning of the file (if offset=1, the first character of the file is pointed to)

1

Relative position from the current pointer position

2

Absolute position counting backward from the end of the file (if offset=1 the last character of the file is pointed to)

stru

Variable of type stru_filehnd that contains the handle obtained via the f_open() function

Result

Returns 1 if the operation resulted in success

Validity

Task

Note

If functions regarding compact flash management are used, it is recommended that bit 14 of the sys_cfg variable (0x00004000) be imposed to 1 to enable the use of safety routines for flash write/read

 

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Contents: ALT+c
Search: ALT+s
Exit Menu/Up: ESC