Ignore:
Timestamp:
2006/11/19 16:49:19 (20 years ago)
Author:
uehara
Message:

blank

File:
1 edited

Legend:

Unmodified
Added
Removed
  • temp/trunk/html/test/uehara/tree.php

    r8583 r8585  
    6969sfprintr($file);    // ¹ÔËö¤Î/¤ò¼è¤ê½ü¤¯ 
    7070                    $dir = ereg_replace("\/$", "", $dir); 
     71                    $path = $dir."/".$file; 
    7172                    $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));  
    7576                    $cnt++; 
    7677                } 
     
    8687 * ´Ø¿ô̾¡§getDirSize() 
    8788 * ÀâÌÀ¡¡¡§»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Ð¥¤¥È¿ô¤ò¼èÆÀ 
    88  * °ú¿ô1 ¡§¥Ç¥£¥ì¥¯¥È¥ê¥Ñ¥¹³ÊǼÇÛÎó 
     89 * °ú¿ô1 ¡§¥Õ¥¡¥¤¥ë³ÊǼÇÛÎó 
    8990 */ 
    9091function 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    } 
    99104    return $bytes;  
    100105}  
Note: See TracChangeset for help on using the changeset viewer.