手机
当前位置:查字典教程网 >编程开发 >C语言 >c++判断是否为目录的示例分享
c++判断是否为目录的示例分享
摘要:复制代码代码如下:#include#includeintis_dir(char*path){structstatbuf;if(lstat(p...

复制代码 代码如下:

#include<sys/stat.h>

#include<unistd.h>

int is_dir(char *path){

struct stat buf;

if(lstat(path , &buf) < 0){

return FALSE;

}

int ret = __S_IFDIR & buf.st_mode;

if(ret){

return TRUE;

}

return FALSE;

}

【c++判断是否为目录的示例分享】相关文章:

C/C++语言中结构体的内存分配小例子

基于C++输出指针自增(++)运算的示例分析

c++ 判断奇数偶数实例介绍

使用C# 判断给定大数是否为质数的详解

c++ 临时对象的来源

C++可变参数的实现方法

判断一个数是不是素数的方法

C/C++中如何判断某一文件或目录是否存在

C++中const的实现机制深入分析

C 字符串数组排序的小例子

精品推荐
分类导航