以下是文件的脚本文件inc.phpfunction getfile($dir)
{
if(is_dir($dir))
{
if ($dh = opendir($dir))
{
while (($file= readdir($dh)) !== false)
{
if((is_dir($dir."/".$file)) && $file!="." && $file!="..")
{
$filename = $dir.$file.'/';
getfile($filename);
}
else
{
if($file!="." && $file!="..")
{
$files[] = $file;
}
}
}
closedir($dh);
}
}
return $files;
}function getfolder($dir)
{
if(is_dir($dir))
{
if ($dh = opendir($dir))
{
while (($file= readdir($dh)) !== false)
{
if((is_dir($dir."/".$file)) && $file!="." && $file!="..")
{
$folder[] = $file;
}
}
closedir($dh);
}
}
return $folder;
}function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}function mysplit($split,$str,$index=1){
list($splitstr[0],$splitstr[1]) = explode($split,$str);
$splitstr[0] = trim($splitstr[0]);
$splitstr[1] = trim($splitstr[1]);
return $splitstr[$index];
}
function deldir($dir) {
$dh=opendir($dir);
while ($file=readdir($dh)) {
if($file!="." && $file!="..") {
$fullpath=$dir."/".$file;
if(!is_dir($fullpath)) {
unlink($fullpath);
} else {
deldir($fullpath);
}
}
} closedir($dh); if(rmdir($dir)) {
return true;
} else {
return false;
}
}
function createFolder($path)
{
if (!file_exists($path)) //如果文件夹不存在
{
createFolder(dirname($path)); //取得最后一个文件夹的全路径返回开始的地方 mkdir($path, 0777);
}
}报错:Warning: rmdir(F:\web\新建文件夹\新建文件夹) [function.rmdir]: Permission denied in inc.php ....请问是什么原因?
{
if(is_dir($dir))
{
if ($dh = opendir($dir))
{
while (($file= readdir($dh)) !== false)
{
if((is_dir($dir."/".$file)) && $file!="." && $file!="..")
{
$filename = $dir.$file.'/';
getfile($filename);
}
else
{
if($file!="." && $file!="..")
{
$files[] = $file;
}
}
}
closedir($dh);
}
}
return $files;
}function getfolder($dir)
{
if(is_dir($dir))
{
if ($dh = opendir($dir))
{
while (($file= readdir($dh)) !== false)
{
if((is_dir($dir."/".$file)) && $file!="." && $file!="..")
{
$folder[] = $file;
}
}
closedir($dh);
}
}
return $folder;
}function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}function mysplit($split,$str,$index=1){
list($splitstr[0],$splitstr[1]) = explode($split,$str);
$splitstr[0] = trim($splitstr[0]);
$splitstr[1] = trim($splitstr[1]);
return $splitstr[$index];
}
function deldir($dir) {
$dh=opendir($dir);
while ($file=readdir($dh)) {
if($file!="." && $file!="..") {
$fullpath=$dir."/".$file;
if(!is_dir($fullpath)) {
unlink($fullpath);
} else {
deldir($fullpath);
}
}
} closedir($dh); if(rmdir($dir)) {
return true;
} else {
return false;
}
}
function createFolder($path)
{
if (!file_exists($path)) //如果文件夹不存在
{
createFolder(dirname($path)); //取得最后一个文件夹的全路径返回开始的地方 mkdir($path, 0777);
}
}报错:Warning: rmdir(F:\web\新建文件夹\新建文件夹) [function.rmdir]: Permission denied in inc.php ....请问是什么原因?
代码里面有啊。说法没有实质性帮助啊。