int fseek(FILE *stream, long int offset, int whence);
long int ftell(FILE *stream);
void rewind(FILE *stream);
int fgetpos(FILE *stream, fpos_t *pos);
int fsetpos(FILE *stream, const fpos_t *pos);
Ftell returns the current value of the offset relative to the beginning of the file associated with the named stream. It is measured in bytes on UNIX; on some other systems it is a magic cookie, and the only foolproof way to obtain an offset for fseek.
Fgetpos stores the current value of the file position indicator for the stream pointed to by stream in the object pointed to by pos. The value stored contains unspecified information usable by the fsetpos function for repositioning the stream to its position at the time of the call to the fgetpos function.
Fsetpos sets the file position indicator for the stream pointed to by stream according to the value of the object pointed to by pos, which must be value returned by an earlier call to fgetpos on the same stream. A successful call clears the end-of-file indicator for the stream and undoes any effects of the ungetc function on the same stream. After call on an update stream, the next operation may be either input or output.
Rewind(stream) is equivalent to: ``(void) fseek (stream, 0L, SEEK_CUR)''
Ftell returns the current value of the file position indicator for the stream, otherwise -1L is returned.
Both fseek and ftell stores an error code in errno when unsuccessful.