Hi!

Well, that's a really good question.

Pre-patch, at the end of the stream (when you don't explicitly seek),
you get empty strings:

I think it's a bug, docs say it's like fgets and fgets returns false on
EOF. Also, "" with this function can mean "delimiter, than another
delimititer" if I understand correctly, because it doesn't return the
delims - which means returning "" on EOF is even worse bug.

Do you want to change the behavior so that it does return false? It's
trivial to do (and I'd agree that it would be correct), but it does
change the behavior from the current behavior.

I think it's a bug and should be changed to return false on EOF, just as fgets does. Of course, if there's data before EOF it should return it, and then next read should return false. The case where file ends with delim should return data before delim on first read, and false on the next after delim was read.
--
Stanislav Malyshev, Zend Software Architect
s...@zend.com   http://www.zend.com/
(408)253-8829   MSN: s...@zend.com

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to