#include<sys/types.h> #include<dirent.h> DIR *dirptr = NULL; struct dirent *entry; dirptr = opendir("/cache/recovery/"); EL ("/cache/recovery"); if(dirptr == NULL) { EL ("opendir failed "); return NULL; } else { EL ("opendir success ! "); while (entry = readdir(dirptr)) { printf("%s ", entry->d_name); } closedir(dirptr); return NULL; }