做一个删除目录的函数
function deldir($path){
if(!is_dir($path)) return false;
clearstatcache();
if(!$fp=opendir($path)) return false;
while($file=readdir($fp)){
if($file!="."&&$file!=".."){
if(is_dir($file)) deldir($path."/".$file);
clearstatcache();
if(is_file($file)) unlink($path."/".$file);
};
};
closedir($path);
rmdir($path);
return true;
};
确保目录权限足够的前提下,为什么上面这个函数会出错?