Function Reference
— Built-in Function: fseek (fid, offset, origin)

Set the file pointer to any location within the file fid.

The pointer is positioned offset characters from the origin, which may be one of the predefined variables SEEK_CUR (current position), SEEK_SET (beginning), or SEEK_END (end of file) or strings "cof", "bof" or "eof". If origin is omitted, SEEK_SET is assumed. The offset must be zero, or a value returned by ftell (in which case origin must be SEEK_SET).

Return 0 on success and -1 on error.

See also: ftell fopen fclose