note 87163 deleted from function.filesize by aharvey
| From: | aharvey@php.net | Date: | Tue, 22 Jan 2013 00:19:35 +0000 |
| Subject: | note 87163 deleted from function.filesize by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-193323@lists.php.net to get a copy of this message | ||
Note Submitter: 7r6ivyeo at mail dot com
----
I use the CLI version of PHP on Windows Vista and work with large (~ 10G) Virtual Machine files.
Here's how to get a NTFS file's size without the 4G limit:
<?php
function dos_filesize($fn) {
if (is_file($fn))
return exec('FOR %A IN ("'.$fn.'") DO @ECHO %~zA');
else
return '0';
}
?>
This should work on any Windows OS that provides DOS shell commands.