最新下载
热门教程
- 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]);
}
相关文章
- 凯叔讲故事怎么设置消费限制 04-02
- 如何使用豆包AI中英对话 04-02
- PPT如何添加动画 04-02
- 剪映国际版如何设置简体中文 04-02
- 蓝海搜书在线书库入口在哪 04-02
- 移动云盘如何下载链接 04-02