请问php.ini中session.save_path的路经...
在php.ini中 session.save_path= mp 此tmp子目录在哪个目...
作者 cbwcbj 发布于 0000-00-00 分类:php基础编程
出错信息为:
Warning: rmdir(././cbw/): Permission denied in C:Inetpubwwwrootftp2delete.php on line 35
删除文件时我是调用下面函数的
当删除文件是成功,当上出目录时出错!出错在该函数的最后一句
rmdir($location);
function deldir($location){
if(substr($location,-1) <> "/") //如果最后一个字符不事"/"
{$location=$location."/"; //补充一个“/”字符
$all=opendir($location); //打开目录
while ($file=readdir($all)){
//如果$file是目录而且不指向当前目录或父目录
if(is_dir($location.$file) && $file <> ".." && $file <> ".")
{deldir($location.$file); //递归调用删除所有子目录中的内容
rmdir($location.$file);
unset($file);
}
elseif(!is_dir($location.$file)){
unlink($location.$file);
unset($file);
}
}
rmdir($location); //最后删除$location目录
}
}
逛论坛交流:我进行删除文件时出错,help!
>//rmdir($location.$file);
>不行呀!如果一个目录里有文件也有文件夹,删除时只能删除文件,不能删除文件夹,报错为程序中的“rmdir($location.$file); 和rmdir($location);"这两行
>权限不对,我不知php中对rmdir是怎样用的,但在系统中rmdir只能del掉目录但目录是空的时
>QUOTE: 最初由 cbwcbj 发布
[B]不行呀!如果一个目录里有文件也有文件夹,删除时只能删除文件,不能删除文件夹,报错为程序中的“rmdir($location.$file); 和rmdir($location);"这两行 [/B]
所以://rmdir($location.$file);
>楼上的你是说不要那句吗?!如果不要,虽然结果显示删除成功
但返回去时那个目录还在,并没有删除呀!!!
>谁能告诉我上面的问题!急!
6 条回复
回复