最新下载
热门教程
- 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]);
}
相关文章
- 过山车之星2游戏联机方法攻略分享 11-02
- 过山车之星2豪华版与标准版内容一览 11-02
- 龙腾世纪4影障守护者守望者宝库内容说明 11-02
- 龙腾世纪4影障守护者第三个盾牌谜题攻略 11-02
- 龙腾世纪4影障守护者第二个盾牌谜题攻略 11-02
- 龙腾世纪4影障守护者第一个盾牌谜题攻略 11-02