.TH rewinddir() "" "" "General Function (libc)"
.PC "Rewind a directory stream"
.B "#include <dirent.h>"
\fBvoid rewinddir(\fIdirp\^\fB)\fR
\fBDIR *\fIdirp\^\fB;\fR
.PP
The \*(CO function
.B rewinddir()
is one of a set of \*(CO routines that manipulate directories in a
device-independent manner.
It resets the current position within the directory stream pointed to by
.I dirp
to the beginning of the directory.
.PP
.B rewinddir()
discards all buffered data for its data stream.
This ensures that your program knows about all modifications to
the directory that occurred since the last time the directory stream
was opened or rewound.
.PP
If an error occurs,
.B rewinddir()
exits and sets
.B errno
to an appropriate value.
.SH "See Also"
.Xr "closedir()," closedir
.Xr "dirent.h," dirent.h
.Xr "getdents()," getdents
.Xr "libc," libc
.Xr "opendir()," opendir
.Xr "readdir()," readdir
.Xr "seekdir()," seekdir
.Xr "telldir()" telldir
.br
\*(PX Standard, \(sc5.1.2
.SH Notes
Because directory entries can dynamically appear and disappear,
and because directory contents are buffered by these routines,
an application may need to continually rescan
a directory to maintain an accurate picture
of its active entries.
.PP
.II "Gwynn, D."
The \*(CO implementation of the
.B dirent
routines was written by D. Gwynn.
