最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
C语言判断目录是否存在的例子
时间:2022-06-25 04:51:49 编辑:袖梨 来源:一聚教程网
例子
#include
#include
#include
#include
#include
int main(int argc,char *argv[])
{
struct stat filestat;
if(argc!=2)
{
printf("Usage ./a.out argv1\n");
exit(-1);
}
if(stat(argv[1],&filestat)!=0)
{
perror(argv[1]);
return -1;
}
if(S_ISDIR(filestat.st_mode))
printf("%s is dir \n",argv[1]);
else
printf("%s is not dir\n",argv[1]);
}
相关文章
- 美团外卖年度报告在哪查看 07-06
- presentation-skills 第一次试跑和结果检查教程(新手)(skill首测版) 07-06
- 原神林尼背景立绘图鉴-原神全部角色介绍 07-06
- 我的乡村日常生活冷狐破解版下载 07-06
- gpt-image2-ppt-skills 本地安装使用教程(新手)(skill安装版) 07-06
- 《息风谷战略》鹤岭门副本流程做法介绍 07-06