| Barry Margolin 2007-02-23, 1:22 am |
|
Please don't multipost. I just responded to you in comp.unix.misc, and
now we have two different threads discussing the same thing.
In article <pan.2007.02.22.10.26.47.408285@web.de>,
unix_fan <tmellman@web.de> wrote:
> From
> http://www.opengroup.org/onlinepubs.../rewinddir.html
>
> DESCRIPTION
>
> The rewinddir() function shall reset the position of the directory
> stream to which dirp refers to the beginning of the directory. It
> shall also cause the directory stream to refer to the current state of
> the corresponding directory, as a call to opendir() would have done.
> If dirp does not refer to a directory stream, the effect is undefined.
>
>
>
>
>
> See quote above. In particular *It
> shall also cause the directory stream to refer to the current state of
> the corresponding directory, as a call to opendir() would have done*
All it has to do is throw away any buffered directory entries and reset
the directory pointer to the beginning. That ensures that it's working
with the current state, and doesn't require any I/O.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
|