note 115555 added to function.filesize
| From: | synnus at gmail dot com | Date: | Thu, 14 Aug 2014 15:42:25 +0000 |
| Subject: | note 115555 added to function.filesize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-200191@lists.php.net to get a copy of this message | ||
Fichier de > 2GB
une maniére plus efficace de connaitre la taille d'un fichier de plus de
2GB . tout d'abord à savoir que ce qui est trés mal expliquer c'est que le pointeur
prend une valeur MAX soit PHP_INT_MAX par astuce pour aller jusqua 4GB comme il n'y a plus de
nombre disponible on Décrémanter jusqu'a 0 . en 32bit PHP_INT_MAX = 2147483647 et donc si
on avance de 1 octet celui-ci passe imédiatement a -2147483647 et le suivant a -2147483646 ..
jusqu'a 0 ! trés facile a comprendre . c'est donc pour cela que je vous propose ce
moyen efficace de'obtenir la taille de votre fichier si celui-ci ne dépasse pas 4GB.
FILE> 2GB (google translation)
a more efficient manner to know the file size of more than
2GB. first of all to know that what is very poorly explained is that the pointer value MAX is
PHP_INT_MAX by trick to go til 4GB as there are more number available on Décrémanter down to
0. 32bit PHP_INT_MAX = 2147483647 so if we move 1 byte it passes immediatly has -2147483647
-2147483646 and the next was down to 0 ..! very easy to understand. This is why I offer this
effective de'obtenir the size of your file if it does not exceed 4GB.
<?php
$pt = ((($pt = filesize("dataX.txt")) < 0) ? ($pt + PHP_INT_MAX*2) + 2 : $pt);
echo $pt."\n";
?>
----
Server IP: 72.52.91.14
Probable Submitter: 84.100.233.151
----
Manual Page -- http://php.net/manual/en/function.filesize.php
Edit -- https://master.php.net/note/edit/115555
Del: integrated -- https://master.php.net/note/delete/115555/integrated
Del: useless -- https://master.php.net/note/delete/115555/useless
Del: bad code -- https://master.php.net/note/delete/115555/bad+code
Del: spam -- https://master.php.net/note/delete/115555/spam
Del: non-english -- https://master.php.net/note/delete/115555/non-english
Del: in docs -- https://master.php.net/note/delete/115555/in+docs
Del: other reasons-- https://master.php.net/note/delete/115555
Reject -- https://master.php.net/note/reject/115555
Search -- https://master.php.net/manage/user-notes.php