ID:               32858
 User updated by:  lew at mailduct dot com
 Reported By:      lew at mailduct dot com
-Status:           Feedback
+Status:           Open
 Bug Type:         Filesystem function related
 Operating System: FreeBSD 4.11-REL
 PHP Version:      4.3.10
 New Comment:

I don't see any changes to the PHP feof library implementation between
4.3.10 and 4.3.11... shall I try it anyway and see if it magically
heals itself?  I say this sarcastically because, if you look at
PR#25649 you'll see that I had to pull teeth just to get someone to
take this seriously.  The default assumption is OE (Operator Error).


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

[2005-04-28 00:04:38] [EMAIL PROTECTED]

Have you tried PHP 4.3.11, the LATEST release..?


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

[2005-04-27 21:36:47] lew at mailduct dot com

Description:
------------
In my prior bug report #25649 from September 2003, I pointed out a
serious bug in how PHP handles FEOF under FreeBSD.  It was fixed by
[EMAIL PROTECTED] and committed.

This same problem (improper handling of feof() by PHP under FreeBSD)
has now crept into current 4.3.X versions of PHP...

Problem:  Once set, the FEOF indicator is not properly cleared when
more data is appended to a file that is opened for read by a PHP
application.

Example:  Suppose I want to "tail" a file using PHP.  Once I hit the
EOF, I will no longer be able to read data from that file even when
another application appends to it.  This is not the correct behaviour
for feof(), as illustrated by the prior fix done by [EMAIL PROTECTED]


Reproduce code:
---------------
--- program:
$fp = fopen( '/var/log/maillog','r' );
while( TRUE ) {
  $r = array( $fp );
  $n = stream_select( $r,$w=NULL,$e=NULL,30 );
  if( $n ) {
    echo fgets( $fp );
  }
}

--- feeder:
echo "This is a test..." >> /var/log/maillog


Expected result:
----------------
For as long as PROGRAM is running, each time I run
FEEDER I expect to see PROGRAM output "This is a test..."

but it does not, because once EOF is reached, it is not
properly reset upon more data being appended to the file.

See pr #25649 for historical info...

Actual result:
--------------
PROGRAM will read the contents of /var/log/maillog until it
reaches EOF, and will not output anything else, even if new
data is appeneded to the file.



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


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

Reply via email to