Har har, you funny man

If you wanted to do it in C, opendir/readdir() would be your best bet. Rather trivial if you ask me