|
发表于 2008-2-16 22:55:31
|
显示全部楼层
你看行不行?- struct stat sbuf;
- if(stat(access_path,&sbuf) < 0) return -1;
- //S_IXUSR & sbuf.st_mode == 0 means it can not be executed
- if(!(S_ISREG(sbuf.st_mode)) || !(S_IXUSR & sbuf.st_mode)) printf("no permission to read the file");
复制代码 |
|