> But I do not know how to write the value to the stream
>
>    php_stream_write(stream, (char*)Z_LVAL_P(*data), 1);
>
> This does not produce the result I need, instead the file contains 48 at
>   this position.
>
That's because you're telling it to write one character from the position
POINTED TO by the integer value.  (i.e. Treat the integer like a pointer)
You're lucky you're getting data at all and not a segfault.

Try:

  php_stream_putc(stream, (char)(Z_LVAL_P(*data) & 0xFF));


-Sara

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

Reply via email to