ID:               24627
 Updated by:       [EMAIL PROTECTED]
 Reported By:      duerra at yahoo dot com
 Status:           Bogus
 Bug Type:         Filesystem function related
 Operating System: XP Pro
 PHP Version:      4.3.3RC1
 New Comment:

It has ALWAYS been the requirement. Some buffer sizes and so were
adjusted in 4.3.2 (or something alike, can't remember exactly what it
was right now) which made it LOOK like it worked for you.



Previous Comments:
------------------------------------------------------------------------

[2003-07-12 22:51:35] duerra at yahoo dot com

Sorry.  Here's from the documentation on "fgets()"

$handle = fopen ("/tmp/inputfile.txt", "r");
while (!feof ($handle)) {
    $buffer = fgets($handle, 4096);
    echo $buffer;
}
fclose ($handle);

In essence, what was being done instead of the line beginning with
"$buffer=", was "$count++".  This this then a requirement now in 4.3.3
that a line is actually retrieved for the file pointer to move?  If so,
I'll quit nagging you all =P

------------------------------------------------------------------------

[2003-07-12 22:48:03] [EMAIL PROTECTED]

Don't mix user added comments to real documentation..


------------------------------------------------------------------------

[2003-07-12 22:45:39] duerra at yahoo dot com

Just a comment from the "feof" reference, as a basic point:

if ($fp = fopen($filename, 'r'))
{
    while (!feof($fp))
    {
          // ...
    }
}

That's exactly what I'm doing here (though the stating of the file
pointer not moving is not explicitly stated, this is shown as working
to a level that I have attempted to code...)

------------------------------------------------------------------------

[2003-07-12 22:42:29] [EMAIL PROTECTED]

There must have been some bug in previous versions,
feof() never moves the file pointer so you end up in endless loop, of
course. (I don't know where in the manual it's said it moves the file
pointer..)


------------------------------------------------------------------------

[2003-07-12 22:39:43] duerra at yahoo dot com

php.net's own manual shows that this should work.  I'm not reading the
file, but rather just gathering a count of each line.  As I stated,
this has always worked in previous versions of PHP, and is also many
tutorials and books, including "PHP and MySQL Web Development" (as I am
looking at the example right now) have shown an example almost
identical to what I've posted here on how to do such looping and
counting.  I believe that the file pointer not moving is exactly the
problem (please correct me if I'm wrong).  Is that not a bug, and if
not, what has changed between 4.3.2 and 4.3.3 that I have not noticed??
 I see nothing of reference in the change log for 4.3.3

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/24627

-- 
Edit this bug report at http://bugs.php.net/?id=24627&edit=1

Reply via email to