#19050 [Opn->Fbk]: Problems with fgets useing large buffers (about 65530)
| From: | sniper@php.net | Date: | Sat, 24 Aug 2002 01:19:04 +0000 |
| Subject: | #19050 [Opn->Fbk]: Problems with fgets useing large buffers (about 65530) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-17712@lists.php.net to get a copy of this message | ||
ID: 19050
Updated by: sniper@php.net
Reported By: darklord@revai.hu
-Status: Open
+Status: Feedback
Bug Type: Filesystem function related
Operating System: Linux Debian Woody
PHP Version: 4.1.2
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2002-08-22 11:37:15] darklord@revai.hu
here's a part of the code I planned to use (it's a method of an
object):
function host_get($file) {
$tmpname=tempnam("/tmp","IWO".uniqid(rand()));
if (!ftp_get($this->ftp_fd,$tmpname,$file,FTP_BINARY))
{
die("Can't download from server");
}
$fd=fopen($tmpname,"r");
$a=array();
while (!feof($fd)) {
$m=fgets($fd,65536);
$a[]=$m;
}
fclose($fd);
unlink($tmpname);
return $a;
}
But sometimes (when 3 times this function was called ) the PHP
interpreter hanged. (I can't reproduce this problem w/o my whole src),
but when I changed the line
$m=fgets($fd,65000);
to
$m=fgets($fd,3000);
The script started to work again ...
I use debian woody with the original apache and php packages, postgres
and ftp modules in this script.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19050&edit=1