#include <dirent.h>
#include <stdio.h>

int main()
{
  DIR *dir; struct dirent *dirp;
  dir=opendir("/tmp/");
  while(1)
  {
    dirp=readdir(dir);
    if(dirp==NULL) break;
    printf("%s\n",dirp->d_name);
  }
  return 0;
}
