// open DIRs
DIR *dir;
struct dirent *dirp;
if ((dp=opendir(fullpath))==NULL){
write_log("No such dir:%s!\n",fullpath);
return -1;
}
如果在dir 前面的DIR加一个struct 修饰符,opendir这里就有 从不兼容的指针类型赋值 警告。
typedef struct __dirstream DIR;
一个Linux在线参考手册http://linux.die.net/