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.
Share
You can use
opendir()repeatedly. Just keep yourDIR *s and callclosedir()when you’re done with each.