首页 > 其他 > 详细

opendir函数

时间:2014-03-01 02:35:10      阅读:758      评论:0      收藏:0      [点我收藏+]

 

bubuko.com,布布扣
          #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 \n", entry->d_name);
                    }
                    closedir(dirptr);
                    return NULL;
                }
bubuko.com,布布扣

opendir函数,布布扣,bubuko.com

opendir函数

原文:http://www.cnblogs.com/sanchrist/p/3573621.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!