Changeset 8585 for temp/trunk/html/test/uehara/tree.php
- Timestamp:
- 2006/11/19 16:49:19 (20 years ago)
- File:
-
- 1 edited
-
temp/trunk/html/test/uehara/tree.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
temp/trunk/html/test/uehara/tree.php
r8583 r8585 69 69 sfprintr($file); // ¹ÔËö¤Î/¤ò¼è¤ê½ü¤¯ 70 70 $dir = ereg_replace("\/$", "", $dir); 71 $path = $dir."/".$file; 71 72 $arrFileList[$cnt]['file_name'] = $file; 72 $arrFileList[$cnt]['file_path'] = $ dir."/".$file;73 $arrFileList[$cnt]['file_size'] = getDirSize($ dir."/".$file);74 $arrFileList[$cnt]['file_time'] = date("Y/m/d", filemtime($ dir."/".$file));73 $arrFileList[$cnt]['file_path'] = $path; 74 $arrFileList[$cnt]['file_size'] = getDirSize($path); 75 $arrFileList[$cnt]['file_time'] = date("Y/m/d", filemtime($path)); 75 76 $cnt++; 76 77 } … … 86 87 * ´Ø¿ô̾¡§getDirSize() 87 88 * ÀâÌÀ¡¡¡§»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Ð¥¤¥È¿ô¤ò¼èÆÀ 88 * °ú¿ô1 ¡§¥ Ç¥£¥ì¥¯¥È¥ê¥Ñ¥¹³ÊǼÇÛÎó89 * °ú¿ô1 ¡§¥Õ¥¡¥¤¥ë³ÊǼÇÛÎó 89 90 */ 90 91 function getDirSize($dir) { 91 $handle = opendir($dir); 92 while ($file = readdir($handle)) { 93 if ($file != '..' && $file != '.' && !is_dir($dir.'/'.$file)) { 94 $bytes += filesize($dir.'/'.$file); 95 } else if (is_dir($dir.'/'.$file) && $file != '..' && $file != '.') { 96 $bytes += getDirSize($dir.'/'.$file); 97 } 98 } 92 if (is_dir($dir)) { 93 $handle = opendir($dir); 94 while ($file = readdir($handle)) { 95 if ($file != '..' && $file != '.' && !is_dir($dir.'/'.$file)) { 96 $bytes += filesize($dir.'/'.$file); 97 } else if (is_dir($dir.'/'.$file) && $file != '..' && $file != '.') { 98 $bytes += getDirSize($dir.'/'.$file); 99 } 100 } 101 } else { 102 $bytes = filesize($dir); 103 } 99 104 return $bytes; 100 105 }
Note: See TracChangeset
for help on using the changeset viewer.
