Tag: 文件列表

将文件列表保存到数组或其他内容C

我有这个function void file_listing(){ DIR *dp; struct stat fileStat; struct dirent *ep; int file=0; dp = opendir (“./”); if (dp != NULL){ while ((ep = readdir(dp))){ char *c = ep->d_name; char d = *c; /* first char */ if((file=open(ep->d_name,O_RDONLY)) d_name); } else{ continue; /* altrimenti non lo listo */ } } } (void) closedir (dp); } […]