| Extracted from Pike v7.8 release 866 at 2018-02-09.

[Top]
Stdio
Stdio.File

# Method Stdio.File()->seek()

Method seek

  `int seek(int pos)`
  `int seek(int unit, int mult)`
  `int seek(int unit, int mult, int add)`

Description

  Seek to a specified offset in a file.

  If mult or add are specified, pos is calculated as `<font face='courier'>pos` = <font face='courier'>unit *<font face='courier'>mult + <font face='courier'>add .

  If pos is negative then it is relative to the end of the file, otherwise it's an absolute offset from the start of the file.

Returns

  Returns the new offset, or `-1` on failure.

Note

  The arguments mult and add are considered obsolete, and should not be used.

See also

  tell()