Bug #30157 [Bgs->Tbd]: ftell() function does not use stream_tell()
| From: | pajoye@php.net | Date: | Sun, 28 Aug 2011 22:06:32 +0000 |
| Subject: | Bug #30157 [Bgs->Tbd]: ftell() function does not use stream_tell() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-162996@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=30157&edit=1
ID: 30157
Updated by: pajoye@php.net
Reported by: tendencies at free dot fr
Summary: ftell() function does not use stream_tell()
-Status: Bogus
+Status: To be documented
Type: Bug
Package: Streams related
Operating System: *
PHP Version: 5CVS-2004-09-19 (dev)
Block user comment: N
Private report: N
New Comment:
Hm, actually let move it as a to be documented instead
Previous Comments:
------------------------------------------------------------------------
[2011-08-28 22:05:36] pajoye@php.net
.
------------------------------------------------------------------------
[2011-08-28 22:01:39] bugs dot php at mohiva dot com
I think this bug can be closed. As described by Gustavo(http://news.php.net/php.internals/54999),
this is by design. And the wrong results, described in the last comments, are errors in my stream
wrapper implementation.
------------------------------------------------------------------------
[2011-08-28 10:53:37] bugs dot php at mohiva dot com
>> Do you have further analyzes to provide?
Please look at the code at https://gist.github.com/1176512
In this scenario stream_tell gets only be executed internally, after calling stream_fseek. This is
the correct behaviour and documented at http://www.php.net/manual/en/streamwrapper.stream-seek.php.
As you can see, the first both ftell calls returns a wrong result. Only the last ftell call returns
the correct result.
------------------------------------------------------------------------
[2011-08-26 13:26:58] bugs dot php at mohiva dot com
Can you explain why this isn't a bug? In my opinion it's a bug, because the stream_tell
method gets never be called in respond to ftell, as it is described in the
documentation(http://www.php.net/manual/en/streamwrapper.stream-tell.php).
>> Do you have further analyzes to provide?
With the provided code snippet, the behaviour is full reproducible.
If this isn't a bug, how can I retrieve the actual file pointer position. For all internal
stream protocols it is possible with ftell. Only for the custom implemented protocols it isn't.
Maybe I'm wrong or I miss something?
------------------------------------------------------------------------
[2011-08-25 12:40:50] pajoye@php.net
There is no bug but a feature request which seems to be very discutable. Do you
have further analyzes to provide?
------------------------------------------------------------------------
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
https://bugs.php.net/bug.php?id=30157
--
Edit this bug report at https://bugs.php.net/bug.php?id=30157&edit=1