in reply to How do I read a directory?

You call opendir, then readdir, and then closedir.

Originally posted as a Categorized Answer.