Navigation

Operators and Keywords

Function List:

C++ API

: fseek (fid, offset)
: fseek (fid, offset, origin)
: status = fseek (…)

Set the file pointer to the location offset 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. offset may be positive, negative, or zero but not all combinations of origin and offset can be realized.

fseek returns 0 on success and -1 on error.

See also: fskipl, frewind, ftell, fopen.

Package: octave