ID: 28621 Updated by: [EMAIL PROTECTED] Reported By: pickett at sumu dot org -Status: Open +Status: Bogus Bug Type: Filesystem function related PHP Version: 4.3.7RC1 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php This is to be expected. Previous Comments: ------------------------------------------------------------------------ [2004-06-03 12:02:10] pickett at sumu dot org Description: ------------ fgets calls will keep returning false if a fd has at some point reached end-of-file, even though the pointer is no longer at EOF. feof() will also keep returning true. Using fread() instead of fgets() works, but is inconvenient if you'd like to read just one line at a time. Reproduce code: --------------- $fdw = fopen("test", "w"); $fdr = fopen("test", "r"); fputs($fdw, "testing 1..\n"); var_dump(fgets($fdr, 0xff)); var_dump(fgets($fdr, 0xff)); fputs($fdw, "testing 2..\n"); var_dump(fgets($fdr, 0xff)); Expected result: ---------------- string(12) "testing 1.. " bool(false) string(12) "testing 2.. " Actual result: -------------- string(12) "testing 1.. " bool(false) bool(false) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28621&edit=1