判断目录下是否有文件
来源:互联网 发布:英伟达显卡生产商知乎 编辑:程序博客网 时间:2024/05/22 10:51
static function dir_isHasFile($dirname){
$handle = opendir($dirname);
$flag = true;//默认是目录下有文件存在的
$file_array = array();
while ( false !== ($file = readdir($handle)) ) {
if($file == '.' || $file == '..'){
continue;
}else{
$file_array[] = $file;
}
}
if ( empty($file_array) ){//没有文件
$flag = false;
}
return $flag;
}
$handle = opendir($dirname);
$flag = true;//默认是目录下有文件存在的
$file_array = array();
while ( false !== ($file = readdir($handle)) ) {
if($file == '.' || $file == '..'){
continue;
}else{
$file_array[] = $file;
}
}
if ( empty($file_array) ){//没有文件
$flag = false;
}
return $flag;
}
- 判断目录下是否有文件
- 判断指定目录是否有文件
- 判断E盘目录下是否有后缀名为.jpg的文件,如果有,就输出该文件名称
- 判断某目录下是否含有某种类型的文件
- qt 下判断文件或目录是否存在?
- linux下判断文件和目录是否存在[总结]
- linux下判断文件和目录是否存在[总结]
- linux下判断文件和目录是否存在[总结]
- 判断是否有文件存在
- delphi 判断目录是否有写入权限
- 判断文件或文件目录是否存在
- 判断文件是否是目录文件
- 命令行模式下判断是否目录
- C VC++ 下判断目录是否存在
- 获取应用程序目录,判断文件是否存在
- shell 判断文件/目录是否为空
- VC判断文件目录是否存在
- shell判断文件,目录是否存在
- 数据库导入导出文件
- VB工程--百例56--用键盘控制小方块移动
- Oracle Enterprise Linux 5
- Android游戏开发
- 用Xmanager远程连接Red hat Enterprise Linux5
- 判断目录下是否有文件
- Linux防火墙
- 六、Struts2之输入校验
- Renaming the current file in Vim
- 2012的目标
- [转]提问的智慧(富格式图文版)
- linux下删除oracle
- C#编写Socket通信
- Android还能走多远啊