Mailinglisten-Archive |
> weiss jetzt niemand Rat ? Was kann mann dagegen tun ?
>
> -> Egon ?
> -> Tobias ?
Sowohl readfile() als auch fread() funktionieren bei mir mit 3.0.12 und 4.0
und einer 34MB-Datei problemlos.
tobias_(at)_dev:~ > cat readfile.php3
<?
readfile("/home/www/logs/access_log");
?>
tobias_(at)_dev:~ > time php -q readfile.php3>tmp.out
real 0m3.120s
user 0m0.350s
sys 0m0.880s
tobias_(at)_dev:~ > ls -l tmp.out
-rw-r--r-- 1 tobias users 34104238 Feb 21 12:27 tmp.out
tobias_(at)_dev:~ > ls -l /home/www/logs/access_log
-rw-r--r-- 1 root root 34104238 Feb 21 12:20
/home/www/logs/access_log
Dasselbe mit fread():
tobias_(at)_dev:~ > cat fread_large.php3
<?
set_time_limit(0);
$fp = fopen("/home/www/logs/access_log", "r");
while(!feof($fp))
{
print(fread($fp, 64));
}
fclose($fp);
?>
tobias_(at)_dev:~ > time php -q fread_large.php3 > tmp.out
real 0m47.376s
user 0m43.030s
sys 0m1.400s
Und spaßeshalber mit PHP 4.0:
tobias_(at)_dev:~ > time php4 -q fread_large.php3 > tmp.out
real 0m15.849s
user 0m13.270s
sys 0m0.890s
tobias_(at)_dev:~ > diff tmp.out /home/www/logs/access_log
tobias_(at)_dev:~ >
Mit freundlichen Grüßen,
Tobias Ratschiller
--
<?$c=$s=0;$a=$t=$x=$y=$b=-2;for(;$b-=$a>2?0.1/($a=-2):0,$b<2;
$s.=chr(30+$c),$a+=0.0503)for($x= /* Tobias Ratschiller */
$y=$c=0;++$c<90&$x*$x+$y*$y<4;$y= /* http://phpWizard.net */
2*$x*$y+$b,$x=$t)$t=$x*$x-$y*$y+$a;print(chunk_split($s,80));?>
php::bar PHP Wiki - Listenarchive