|
代码如下:
function deldir($dir)
{
if ($handle = opendir($dir))
{
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != "..")
{
$fullpath=$dir."/".$file;
//echo "full path:$fullpath<br>";
if(is_dir($fullpath))
{
deldir($fullpath);
}
}
}
echo "to del file:$dir<br>";
rmdir($dir);
closedir($handle);
}
}
delfile($dir);
deldir($dir);
出现问题如下:
to del file:D:/AppServ/www/hy/html/107/1/2
Warning: rmdir(D:/AppServ/www/hy/html/107/1/2) [function.rmdir]: Permission denied in D:\AppServ\www\hy\del.php on line 48
to del file:D:/AppServ/www/hy/html/107/1/3
Warning: rmdir(D:/AppServ/www/hy/html/107/1/3) [function.rmdir]: Permission denied in D:\AppServ\www\hy\del.php on line 48
to del file:D:/AppServ/www/hy/html/107/1/4
Warning: rmdir(D:/AppServ/www/hy/html/107/1/4) [function.rmdir]: Permission denied in D:\AppServ\www\hy\del.php on line 48
to del file:D:/AppServ/www/hy/html/107/1/5
Warning: rmdir(D:/AppServ/www/hy/html/107/1/5) [function.rmdir]: Permission denied in D:\AppServ\www\hy\del.php on line 48
to del file:D:/AppServ/www/hy/html/107/1/6
Warning: rmdir(D:/AppServ/www/hy/html/107/1/6) [function.rmdir]: Permission denied in D:\AppServ\www\hy\del.php on line 48
to del file:D:/AppServ/www/hy/html/107/1/7
Warning: rmdir(D:/AppServ/www/hy/html/107/1/7) [function.rmdir]: Permission denied in D:\AppServ\www\hy\del.php on line 48
to del file:D:/AppServ/www/hy/html/107/1
Warning: rmdir(D:/AppServ/www/hy/html/107/1) [function.rmdir]: Permission denied in D:\AppServ\www\hy\del.php on line 48
to del file:D:/AppServ/www/hy/html/107/2
Warning: rmdir(D:/AppServ/www/hy/html/107/2) [function.rmdir]: Permission denied in D:\AppServ\www\hy\del.php on line 48
to del file:D:/AppServ/www/hy/html/107
Warning: rmdir(D:/AppServ/www/hy/html/107) [function.rmdir]: Permission denied in D:\AppServ\www\hy\del.php on line 48
to del file:D:/AppServ/www/hy/html/yuiop
Warning: rmdir(D:/AppServ/www/hy/html/yuiop) [function.rmdir]: Permission denied in D:\AppServ\www\hy\del.php on line 48
to del file:D:/AppServ/www/hy/html
Warning: rmdir(D:/AppServ/www/hy/html) [function.rmdir]: Permission denied in D:\AppServ\www\hy\del.php on line 48
目录找对了(也是空的) 但是就是删不到
望指教 |
|