; "type" => is_file($i) ? 1 : (is_dir($i) ? 0 : -1)
);
$result = $t;
}
closedir($dh);
unset($dh, $fh, $t, $i);
clearstatcache(); // 清除文件系统缓存
return $this->result = $result;
}
/**
* @]Method Name[= file_info()
* @]Purpose[=
* 获取指定文件或目录的属性
* @]Parameter[=
* string $dir_path 指定目录路径,默认为当前目录
* @]Return[= mixed 错误返回 FALSE,否则返回
* array("name","location","type","size","access","change","modify","read","write"),
* @]Author[= SNakeVil <51JS,BU,PHPx> (snakevil@qq.com)
* @]See[=
*/
function file_info($path=".") {
$path = realpath($path);
if (!$path) return $this->error_occur(0x000A, __FUNCTION__);
$result = array(
"name" => substr($path, strrpos($path, DIRECTORY_SEPARATOR)+1),
"location" => $path,
"type" => is_file($path) ? 1 : (is_dir($path) ? 0 : -1),
"size" => filesize($path)