Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

rewind - reset file position indicator to start of stream

&pagelevel(4)&pagelevel

Syntax

#include <stdio.h>

void rewind(FILE *stream);

Description

The call rewind(stream) is equivalent to:
(void) fseek(stream, 0L, SEEK_SET)
except that rewind() also clears the error indicator for stream.

Errors

Notes

See fseek() - with the exception of EINVAL.

Since rewind() does not return a value, an application wishing to detect errors should first
set errno to 0, then call rewind(), and if errno is non-zero, assume that an error has
occurred.

The program environment determines whether rewind() is executed for a BS2000 or
POSIX file.

BS2000
rewind() can also be used without changes for files with record I/O. (End)

See also

fseek(), fsetpos(), stdio.h.