in reply to
Re^3: Efficient processing of large directory
in thread Efficient processing of large directory
Now I know that readdir exists (thanks Aristotle!) I was able to RTFM and put it into practice. Those functions that do not require me to open the files have improved stunningly. So much so that the client rang me at home to thank me and backed it up with an email full of exclamation marks.
Now I have to further improve the processes that have to read all the files. But I guess that's another thread!