码迷,mamicode.com
首页 >  
搜索关键字:递归打印目录下的文件名. opendir readdir    ( 197个结果
-----------------------------------项目中整理的非常有用的PHP函数库(二)-----------------------------------------------------
6、PHP列出目录下的文件名如果你想列出目录下的所有文件,使用以下代码即可:function listDirFiles($DirPath){ if($dir = opendir($DirPath)){ while(($file = readdir($dir))!== fal...
分类:Web程序   时间:2015-11-12 23:37:45    阅读次数:329
Linux C语言遍历目录结构
遍历目录结构查找文件是很常用的功能,今天介绍一下使用Linux C 遍历Linux目录结构的方法: linux提供几个系统调用,以便于直接目录的读取和操作: DIR * opendir(const char * pathname); struct dirent * readdir(DIR *...
分类:编程语言   时间:2015-10-21 22:40:58    阅读次数:197
PHP文件操作
1.递归获取目录下文件的个数function getFileCount($dir){ if(!is_dir($dir)) return false; //打开目录 $handle = opendir($dir); static $i = 0 ; whi...
分类:Web程序   时间:2015-10-15 20:33:45    阅读次数:142
目录操作
opendir 打开目录closedir 关闭目录readdir 读取目录scandir 返回一个含有目录和文件的数组mkdir 创建目录rmdir 删除目录basename 返回路径中文件名部分 当指定了可选参数 就将他去掉pathinfo() 返回一个关联数组 其中包括路径中的三个部分:目录名,...
分类:其他好文   时间:2015-10-15 14:14:10    阅读次数:221
遍历一个文件夹下的所有文件和子文件夹
function listDir($dir = '.'){ if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if($file == '.' || $f...
分类:其他好文   时间:2015-09-21 22:33:41    阅读次数:171
递归删除目录
1 //递归删除目录 2 3 function deldir($path){ 4 5 //不是目录 6 if(!is_dir($path)){ 7 return NULL; 8 } 9 10 $db = opendir($path);11 ...
分类:其他好文   时间:2015-09-16 15:38:49    阅读次数:155
php列出目录下所有文件带点击链接
<?php $num=0;//用来记录目录下的文件个数 $dirname=‘./‘;//要遍历的目录名字 $dir_handle=opendir($dirname); echo‘<tableborder="1"align="center"width="960px"cellspacing="0"cellpadding="0">‘; echo‘<caption><h2>目录‘.$dirname.‘的内容</h2&g..
分类:Web程序   时间:2015-09-06 11:13:50    阅读次数:284
Linux Opendir and readdir will not update along with directory changing
Linux Opendir and readdir will not update along with directory changingTable of Contents1. Result2. temporary fix method3. Test1 ResultAccording to my...
分类:系统相关   时间:2015-09-02 00:27:40    阅读次数:213
PHP目录的遍历
PHP目录的遍历 <?php? //php目录的遍历 function?showDetail($dirname){ $ds?=?opendir($dirname); while($file?=?readdir($ds)){ $path?=?$dirname."/".$file; if($file?!=?"."?&&?$file?!=?"..")...
分类:Web程序   时间:2015-09-01 20:08:44    阅读次数:188
C&C++——库头文件及其作用
1、 一些头文件的作用::ANSI C。提供断言,assert(表达式):GCC。GTK,GNOME的基础库,提供很多有用的函数,如有数据结构操作函数。使用glib只需要包含:GCC。文件夹操作函数。struct dirent,struct DIR,opendir(),closedir(),read...
分类:编程语言   时间:2015-08-31 11:42:49    阅读次数:251
197条   上一页 1 ... 10 11 12 13 14 ... 20 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!