MicrOS
fseek.c File Reference
#include "../stdio.h"

Functions

int fseek (FILE *stream, long int offset, int origin)
 Reposition stream position indicator. More...
 

Function Documentation

◆ fseek()

int fseek ( FILE stream,
long int  offset,
int  origin 
)

Reposition stream position indicator.

Sets the position indicator associated with the stream to a new position.

Parameters
streamPointer to a FILE object that identifies the stream to be closed.
offsetNumber of bytes to offset from origin.
originPosition used as reference for the offset. It is specified by one of the constants (file begin: SEEK_SET, current position: SEEK_CUR, end of file: SEEK_END).
Returns
If successful, the function returns zero. Otherwise, it returns non-zero value and error indicator is set.