stat() 之权限查看

查看文件的权限方式

struct stat *file_info = calloc(1,sizeof(struct stat));
    stat(dir,file_info);
    unsigned int mask = 0000777;
    unsigned int access = mask & file_info->st_mode;
    printf("before chmod dir mode = %o, flowop mode = %o\n", access, flowop->fo_modes);