PHP 4.0 Bug #6023 Updated: Problem with either fgets or ftell in ISAPI
| From: | Bug Database | Date: | Tue, 03 Oct 2000 03:03:16 +0000 |
| Subject: | PHP 4.0 Bug #6023 Updated: Problem with either fgets or ftell in ISAPI | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-34020@lists.php.net to get a copy of this message | ||
ID: 6023
Updated by: sniper
Reported By: slords@mail.com
Status: Closed
Bug Type: *General Issues
Assigned To:
Comments:
No feedback. Please upgrade to php4.0.3 when it is released real soon now and reopen this bug report
if problem still exists.
--Jani
Previous Comments:
---------------------------------------------------------------------------
[2000-09-02 22:28:48] sniper@php.net
Have you tried php4.0.2 or latest CVS or snapshot from http://snaps.php.net ??
Does this problem still exist in newer versions?
--Jani
---------------------------------------------------------------------------
[2000-08-08 10:33:19] slords@mail.com
<?
$file = fopen("C:Test.Txt", "w");
fputs($file, "0123456789rn");
fputs($file, "0123456789rn");
fclose($file);
$file = fopen("C:Test.Txt", "r+");
$line = fgets($file, 1024);
echo ftell($file)."<P>";
echo strlen($line)."<P>";
fseek($file, ftell($file) - strlen($line));
fputs($file, "test");
fclose($file);
echo "Done";
?>
The code above produces different outputs depending on if php.exe or php4isapi.dll is run. Both
create a file with 2 lines with 0-9 on a line. The php.exe will then back up and overwrite the 0-3,
but the php4isapi.dll will back up and overwrite the 1-4.
Output of pgp.exe
=================
12<P>12<P>Done
Output of php4isapi.dll
=======================
13<P>12<P>Done
This bug has been reproduced on Windows 95/98/NT/2000 and on version 4.0, 4.0.1, 4.0.1pl1, 4.0.1pl2.
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=6023