Ask a Question related to PHP Development, Design and Development.
-
diz at ysagoon dot com #1
#22546 [Com]: fread (maybe in connection with fseek) do not read "length" bytes
ID: 22546
Comment by: diz at ysagoon dot com
Reported By: 4u at direct-netware dot de
Status: Bogus
Bug Type: Filesystem function related
Operating System: WinNT
PHP Version: 4.3.1
New Comment:
I don't know if this is related, but I think so. Please tell me if I
should better submit this as a new bug.
The fseek teleports my file pointer to some strange places. I'm using
Win2K (NT5 SP4) with administrative rights and I'm running EasyPhp
1.6.0.0 that contains PHP 4.2.0. But the same script works on Debian
GNU/Linux 2.2.20 with PHP 4.1.2!
Here's my example script (note that none of the two fseek methods
work):
function getChar($fp, &$c)
{
$c=fgetc($fp);
if(feof($fp))
return false;
return true;
}
$fp=fopen('parseTest.txt','r');
while(true)
{
$c=fgetc($fp);
if(feof($fp))
break;
echo("$c");
//fseek($fp, -1, SEEK_CUR);
fseek($fp, ftell($fp)-1);
$c=fgetc($fp);
if(feof($fp))
break;
echo("$c");
}
fclose($fp);
echo('<EOF>');
The file that I read contains just this:
Hello World!
The correct output on Debian GNU/Linux 2.2.20 with PHP 4.1.2:
hheelllloo wwoorrlldd!!
<EOF>
The problematic output on Win2k with PHP 4.2.0:
h<EOF>
Ok that's it. Thank you for your support! :)
Gabriel
Previous Comments:
------------------------------------------------------------------------
[2003-03-05 08:17:52] 4u at direct-netware dot de
Strange things happening here - I will check it before getting on your
nerves again ;)
------------------------------------------------------------------------
[2003-03-05 07:54:57] 4u at direct-netware dot de
I know how to install PHP using a ZIP-file...
1,22 MB (1.286.144 Bytes) - Is this the right dll? (At least this is
the dll in the snapshot I downloaded - Last edited today)
The error still exists with the dll, mentioned above!
------------------------------------------------------------------------
[2003-03-05 06:48:56] [email]sniper@php.net[/email]
Just replace every existing php4ts.dll with the new one from the
snapshot package..and make sure nothing is running when you do this.
------------------------------------------------------------------------
[2003-03-05 06:25:52] 4u at direct-netware dot de
I'm sorry, but then the bug isn't (completly?) removed - used snapshot
resulting fread-error: php4-win32-STABLE-200303050930
------------------------------------------------------------------------
[2003-03-05 06:20:38] [email]wez@php.net[/email]
This was fixed last week; any current snapshot should contain the fix.
------------------------------------------------------------------------
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
[url]http://bugs.php.net/22546[/url]
--
Edit this bug report at [url]http://bugs.php.net/?id=22546&edit=1[/url]
diz at ysagoon dot com Guest
-
#37773 [Asn->Csd]: iconv_substr() gives "Unknown error" when string length = 1"
ID: 37773 Updated by: iliaa@php.net Reported By: dave at dgx dot cz -Status: Assigned +Status: Closed Bug Type: ICONV... -
#37773 [Ver->Asn]: iconv_substr() gives "Unknown error" when string length = 1"
ID: 37773 Updated by: tony2001@php.net Reported By: dave at dgx dot cz -Status: Verified +Status: Assigned Bug Type: ... -
#22682 [Fbk->NoF]: Proplems with fread(), ftell() and fseek() and CRLF newlines
ID: 22682 Updated by: sniper@php.net Reported By: fbeyer at clickhand dot de -Status: Feedback +Status: ... -
#22682 [Ana->Fbk]: Proplems with fread(), ftell() and fseek() and CRLF newlines
ID: 22682 Updated by: sniper@php.net Reported By: fbeyer at clickhand dot de -Status: Analyzed +Status: ... -
#22682 [Com]: Proplems with fread(), ftell() and fseek() and CRLF newlines
ID: 22682 Comment by: henrik dot gebauer at web dot de Reported By: fbeyer at clickhand dot de Status: Analyzed...



Reply With Quote

