#include
#include
#include
int main()
{
DIR *dir=NULL;
struct dirent* pDir=NULL;
dir=opendir("/proc");
if(dir == NULL)
printf("Error! can't open this dir\n");
else
{
pDir = readdir(dir);
if(pDir == NULL)
{
printf("Error! can't read this dir");
}
else
{
while(pDir != NULL)
{
printf("%s\n",pDir ->d_name);
pDir = readdir(dir);
}
}
}
closedir(dir);
return 0;
}
阅读(1423) | 评论(0) | 转发(0) |