c代码读取目录信息

#include <stdio.h>
#include <sys/types.h>
#include <dirent.h>

int main(void)
{
    DIR *dir;
    struct dirent *o;
    dir = opendir ("./");

    if (dir != NULL)
    {
        while ((o = readdir (dir)) != NULL)
        {
            printf("%s %d %llu\n", o->d_name, o->d_type, o->d_ino);
        }

        (void) closedir (dir);
    }
    else
    {
        perror ("Couldn't open the directory");
    }

    return 0;
}
上一篇:看天猫EDM营销学企业EDM营销


下一篇:EDM营销应注意要定期发送邮件