#41815 [Fbk->Csd]: Concurrent read/write fails when EOF is reached

From: Date: Thu, 12 Jul 2007 11:01:24 +0000
Subject: #41815 [Fbk->Csd]: Concurrent read/write fails when EOF is reached
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-114967@lists.php.net to get a copy of this message
ID: 41815 Updated by: jani@php.net -Summary: After EOF, fread() cannot read appended bytes. Reported By: mpb dot mail at gmail dot com -Status: Feedback +Status: Closed Bug Type: Streams related Operating System: Linux 2.6 PHP Version: 5.2.3 Assigned To: pollita New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2007-07-11 07:05:15] tony2001@php.net Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows (zip): http://snaps.php.net/win32/php5.2-win32-latest.zip For Windows (installer): http://snaps.php.net/win32/php5.2-win32-installer-latest.msi ------------------------------------------------------------------------ [2007-06-26 18:56:51] mpb dot mail at gmail dot com Description: ------------ If you fread() to the end of a file, and then additional bytes are appended to the file, future calls to fread() never return the appended bytes. This problem may have started with PHP 5.2.0. This problem still exists in PHP 5.2.3. PHP 4.4.7 does NOT suffer from this problem. Reproduce code: --------------- <?php $f = fopen ('test', 'w'); $g = fopen ('test', 'r'); fwrite ($f, "This is line 1.\n"); fflush ($f); print fread ($g, 100); fwrite ($f, "This is line 2.\n"); fflush ($f); print fread ($g, 100); ?> Expected result: ---------------- This is line 1. This is line 2. Actual result: -------------- This is line 1. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41815&edit=1

« previous php.bugs (#114967) next »