note 80959 added to function.filesize

From: Date: Fri, 08 Feb 2008 11:14:37 +0000
Subject: note 80959 added to function.filesize
Groups: php.notes 
Request: Send a blank email to php-notes+get-135899@lists.php.net to get a copy of this message
I have created a handy function, using parts of code from kaspernj at gmail dot com and md2perpe at gmail dot com, which should get file sizes > 4GB on Windows, Linux and Mac (at least). function getSize($file) { $size = filesize($file); if ($size < 0) if (!(strtoupper(substr(PHP_OS, 0, 3)) == 'WIN')) $size = trim(stat -c%s $file); else{ $fsobj = new COM("Scripting.FileSystemObject"); $f = $fsobj->GetFile($file); $size = $file->Size; } return $size; } ---- Server IP: 203.202.10.60 Probable Submitter: 202.61.134.168 (proxied: 202.61.134.168) ---- Manual Page -- http://www.php.net/manual/en/function.filesize.php Edit -- https://master.php.net/note/edit/80959 Del: integrated -- https://master.php.net/note/delete/80959/integrated Del: useless -- https://master.php.net/note/delete/80959/useless Del: bad code -- https://master.php.net/note/delete/80959/bad+code Del: spam -- https://master.php.net/note/delete/80959/spam Del: non-english -- https://master.php.net/note/delete/80959/non-english Del: in docs -- https://master.php.net/note/delete/80959/in+docs Del: other reasons-- https://master.php.net/note/delete/80959 Reject -- https://master.php.net/note/reject/80959 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#135899) next »