您的位置:首页 > 运维架构 > Linux

linux判断一个文件是否存在

2011-11-28 17:46 274 查看
1 #include <stdio.h>
2 #include <fcntl.h>
3
4 int main(void)
5 {
6
7   int fd;
8   fd = open("a1.out", O_RDONLY | O_CREAT | O_EXCL);
9   if (fd < 0)
10    printf("file is exists!");
11  return 0;
12 }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: