linux c中的测试文件权限(access)
来源:互联网 发布:库房库存数据分析 编辑:程序博客网 时间:2024/05/18 03:21
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
int main(int argc,char* argv[])
{
if(access("ceshi",F_OK) == 0)
{
printf("文件存在!\n");
}
if(access("ceshi",R_OK)==0)
{
printf("R");
}
if(access("ceshi",W_OK)==0)
{
printf("W");
}
if(access("ceshi",X_OK)==0)
{
printf("X");
}
return 0;
}
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
int main(int argc,char* argv[])
{
if(access("ceshi",F_OK) == 0)
{
printf("文件存在!\n");
}
if(access("ceshi",R_OK)==0)
{
printf("R");
}
if(access("ceshi",W_OK)==0)
{
printf("W");
}
if(access("ceshi",X_OK)==0)
{
printf("X");
}
return 0;
}
0 0
- linux c中的测试文件权限(access)
- 4.7 access函数-文件权限测试
- Linux中的文件权限
- Linux中的文件权限
- LINUX中的文件权限
- Linux中的文件权限
- linux中的文件权限
- linux access函数判断文件存取权限
- linux access函数判断文件存取权限
- access函数 权限测试
- Linux中的目录权限以及文件权限
- Linux系统中的文件权限
- Linux中的文件特殊权限
- Linux中的文件特殊权限
- Linux中的文件特殊权限
- Linux中的文件特殊权限
- Linux中的文件权限详解
- Linux中的文件特殊权限
- tableview的cell的分割线怎么不是满的
- Problem 48 Self powers (技巧)
- 《深入理解Java虚拟机》读书笔记3
- 《APUE》笔记-第五章-标准I/O库
- easyui-datagrid向后台传送其它的参数
- linux c中的测试文件权限(access)
- java中方法重写(Override)与方法重载(Overload)的区别
- 剑指offer面试题3
- 注册表API函数和获取系统版本
- hdu5937 Equation
- USB2.0协议分析
- 乘法口诀02
- leetcode(3)7.Reverse Integer
- linux c中修改文件权限