ID:               49148
 Updated by:       garre...@php.net
 Reported By:      mugeso at mugeso dot com
 Status:           Open
 Bug Type:         Streams related
 Operating System: win32 only - Windows XP SP3
 PHP Version:      5.2.10
 New Comment:

This is reproduceable on Linux too.





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

[2009-08-04 07:44:16] mugeso at mugeso dot com

Description:
------------
When use in combination of stream_get_line and fseek,
reading a file which has only 2 lines without ending on EOF(like below)
does fail.
This happens on only Windows and with only "2lines file without ending
on EOF".



Reproduce code:
---------------
2lines.txt
--
a<CRLF>
b<EOF>

phpfile:
--
<?php
$file = dirname(__FILE__) . '/2lines.txt';
$fp = fopen($file, "rb");
var_dump(stream_get_line($fp, null, "\xd\xa"));
fseek($fp, ftell($fp)); // expected that this does not affect result.
var_dump(stream_get_line($fp, null, "\xd\xa"));

Expected result:
----------------
string(1) "a"
string(1) "b"


Actual result:
--------------
string(1) "a"
bool(false)



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


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

Reply via email to