fseek()

This is a file I/O function, also hardware dependent. It is not implemented in this Compiler.

Syntax
  #include <stdio.h>

  
  int fseek(FILE *f, long offset, int mode);

  
Description

fseek() sets the current position in file f.

For binary files, the position can be set in three ways, as shown in this table.

Table 1. fseek() Function Offset Position into the File
Mode Set Position
SEEK_SET offset bytes from the beginning of the file.
SEEK_CUR offset bytes from the current position.
SEEK_END offset bytes from the end of the file.

For text files, either offset must be zero or mode is SEEK_SET and offset a value returned by a previous call to ftell().

If fseek() is successful, it clears the file's end-of -file flag. The position cannot be set beyond the end of the file.

Return

Zero, if successful; non-zero otherwise.

See also

fgetpos()

fsetpos()

ftell()