read()) { if(substr($file,0,1)=='.') continue; if($filter && !preg_match($filter, $file)) continue; if($to_lower) $file = strtolower($file); if($filter) $file = preg_replace($filter, '$1', $file); else $file = $file; if($concat_prefix) $file = $path.$file; $output[] = $file; } if(!$output) return array(); return $output; } /** * @brief 디렉토리 생성 * * 주어진 경로를 단계별로 접근하여 recursive하게 디렉토리 생성 **/ function makeDir($path_string) { $path_list = explode('/', $path_string); for($i=0;$iread()) { if ($entry != "." && $entry != "..") { if (is_dir($path."/".$entry)) { FileHandler::removeDir($path."/".$entry); } else { @unlink($path."/".$entry); } } } $directory->close(); @rmdir($path); } /** * @brief byte단위의 파일크기를 적절하게 변환해서 return **/ function filesize($size) { if(!$size) return "0Byte"; if($size<1024) return ($size."Byte"); if($size >1024 && $size< 1024 *1024) return sprintf("%0.1fKB",$size / 1024); return sprintf("%0.2fMB",$size / (1024*1024)); } } ?>