I am trying to debug right now in C and am curious if it is alright to call opendir() repeatedly without having to first call closedir() because I am trying to run a loop to open sub-directories when the while-loop that calls readdir() encounters them. And I assume that closing the current directory would cause me to lose the ability to read it.
For example, let s say I want to find a particular word or number in a file. The contents are in sorted order (obviously). Since I want to run a binary search on the file, it seems like a real waste ...