From:             tendencies at free dot fr
Operating system: Windows and Linux
PHP version:      5CVS-2004-09-19 (dev)
PHP Bug Type:     Filesystem function related
Bug description:  ftell() function don't use stream_tell()

Description:
------------
For a test, I use wrapper_register() to register a new wrapper. For
information, I use PHP5 CVS and apache.

I want to create a wrapper and use ftell() to return an integer different
from the length of the string (normal comportement). I implement the
method stream_tell() and call ftell(), but surprise, this function don't
use the method stream_tell().

Reproduce code:
---------------
<?php
class fileWrapper {
    var $fp;
    function stream_open($path, $mode, $options, &$opened_path){
        $url = parse_url($path);
        $this->fp = fopen($url["host"], $mode);
        return true;
    }
    function stream_write($data){
        return fwrite($this->fp, $data);
    }
    function stream_tell(){
        echo "debug message";
        return ftell($this->fp);
    }
    function stream_close(){
        return fclose($this->fp);
    }
}
stream_wrapper_register("test", "fileWrapper");
$fp = fopen("test://file.txt", "w+");
fwrite($fp, "test");
echo "I test the echo debug in stream_tell() method:";
echo ftell($fp)."\n";
fclose($fp);
?>

Expected result:
----------------
Use the code above, I write a "debug message" in the method stream_tell()
but no message is writted in my screen, just this :
I test the echo debug in stream_tell() method:0

I think that it's a bug but if not, all my apologies.


-- 
Edit bug report at http://bugs.php.net/?id=30157&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=30157&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30157&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30157&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=30157&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=30157&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=30157&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=30157&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=30157&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=30157&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=30157&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=30157&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=30157&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=30157&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=30157&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=30157&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=30157&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=30157&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=30157&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=30157&r=mysqlcfg

Reply via email to