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语言链表操作示例分享