06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

pREPC+ <strong>System</strong> <strong>Calls</strong> fseek<br />

fseek Sets the file position indicator.<br />

#include <br />

#include <br />

int fseek(<br />

FILE *stream, /* stream pointer */<br />

long offset, /* file offset */<br />

int whence /* relative file base */<br />

)<br />

Description<br />

Arguments<br />

The fseek() function sets the file position indicator for the stream pointed to by<br />

stream.<br />

For a text stream, either offset should be zero, or offset should be a value<br />

returned by an earlier call to ftell function on the same stream and base should<br />

be SEEK_SET.<br />

A successful call to fseek() clears the stream's end-of file indicator and undoes<br />

any effect of ungetc function on the same stream.<br />

If stream refers to an I/O device, this function does nothing and returns a zero.<br />

stream Points to an open pREPC+ stream.<br />

offset For a binary stream, specifies the offset value, which will be added to<br />

the position specified by whence to calculate the new value of the<br />

position indicator.<br />

whence Specifies the relative file base. whence can have one of the following<br />

values:<br />

Value Description<br />

SEEK_SET Beginning of file<br />

SEEK_CUR Current position in file<br />

SEEK_END End of file<br />

<strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong> 3-61<br />

3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!