当前位置: 技术问答>linux和unix
请问unix 对应dos findfirst的函数是opendir吗?
来源: 互联网 发布时间:2014-11-07
本文导语: 我用fp=opendir(*.vce)及fpt=readdir(fp); 怎么fpt->d_name老是空的? | 列出一个目录的所有文件: dp = opendir("path of your dir"); while((dirp = readdir(dp)) != NULL) printf("%sn", dirp->d_name; closedir(dp);
我用fp=opendir(*.vce)及fpt=readdir(fp);
怎么fpt->d_name老是空的?
怎么fpt->d_name老是空的?
|
列出一个目录的所有文件:
dp = opendir("path of your dir");
while((dirp = readdir(dp)) != NULL)
printf("%sn", dirp->d_name;
closedir(dp);
dp = opendir("path of your dir");
while((dirp = readdir(dp)) != NULL)
printf("%sn", dirp->d_name;
closedir(dp);