Getting back to the top of the directory [Archive] - C Board

PDA

View Full Version : Getting back to the top of the directory


samGwilliam
02-25-2002, 08:32 AM
When I use the readdir command to read directory entries into my program, what do I do when I've read the last directory and readdir () returns NULL? What I want to do is return to the top of the directory so the readdir () calls will start returning directory entries from the directory again. How can this be done?

alex
02-25-2002, 12:06 PM
rewinddir(dir);

alex

samGwilliam
02-25-2002, 04:49 PM
Thank you very much!