只能說被騙了~"~

還以為某檔案壞掉

檔案大小一直抓不正確

原來是php裡的filesize function 只支援到4 Gb.....


Fix 4Gb limit. ( Now limit 8 Gb ;))

    function GetRealSize($file) {
       
// Return size in Mb
       
clearstatcache();
       
$INT = 4294967295;//2147483647+2147483647+1;
       
$size = filesize($file);
       
$fp = fopen($file, 'r');
       
fseek($fp, 0, SEEK_END);
        if (
ftell($fp)==0) $size += $INT;
       
fclose($file);
        if (
$size<0) $size += $INT;
        return
ceil($size/1024/1024);
    }
?>
arrow
arrow
    全站熱搜

    herb123456 發表在 痞客邦 留言(0) 人氣()