Re: PHP Stream wrappers seek with whence SEEK_CUR doesn't work
| From: | Johannes Schlüter | Date: | Wed, 04 Nov 2009 11:11:40 +0000 |
| Subject: | Re: PHP Stream wrappers seek with whence SEEK_CUR doesn't work | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-45950@lists.php.net to get a copy of this message | ||
Hi,
On Wed, 2009-11-04 at 10:18 +0100, Davide Romanini wrote:
> My php version:
> PHP 5.2.8 (cli) (built: Dec 17 2008 00:54:27)
Please use a recent version of PHP.
> Copyright (c) 1997-2008 The PHP Group
> Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
> with Zend Extension Manager v1.0.11, Copyright (c) 2003-2006, by
> Zend Technologies
> with Zend Optimizer v3.2.0, Copyright (c) 1998-2006, by Zend
> Technologies
> with Zend Debugger v5.2.2, Copyright (c) 1999-2006, by Zend Technologies
Please disable third party modules before reporting any issues to us.
> I've attached a simple script to reproduce the bug. It's a modified
> version of the example stream wrapper at
>
>http://www.php.net/manual/en/stream.streamwrapper.example-1.php.
[...]
> It seems that the SEEK_CUR parameter is always ignored and the whence
> value passed to my wrapper is SEEK_SET.
I think (didn't verify) that PHP keeps track of the position and
rewrites CUR to SET accordingly, but as said: Didn't verify.
johannes