Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10444 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21675 invoked by uid 1010); 14 Jun 2004 16:23:11 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 21640 invoked from network); 14 Jun 2004 16:23:10 -0000 Received: from unknown (HELO rot2.de) (217.160.191.196) by pb1.pair.com with SMTP; 14 Jun 2004 16:23:10 -0000 Received: from php-tools.net (p50839CC2.dip.t-dialin.net [80.131.156.194]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by rot2.de (Postfix) with ESMTP id 1BAFA2CE991 for ; Mon, 14 Jun 2004 18:14:34 +0200 (CEST) Message-ID: <40CDD0EC.5070905@php-tools.net> Date: Mon, 14 Jun 2004 18:23:08 +0200 Organization: PHP Application Tools User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4; MultiZilla v1.5.0.3g) Gecko/20031007 X-Accept-Language: en-us, de, en MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Need help with streams From: schst@php-tools.net (Stephan Schmidt) Hi, I'm working on ext/id3 (proposed in pecl) and I'm currently experiencing a problem. I got a function that is used to update the information in an ID3 tag. The user passes an array and I update all information that has been passed. One of the possible tokens is a genre ID which is represented by an integer: $new = array( 'title' => 'My Song', 'genre' => 23 ); Now I need to write the character that represents 34 to the stream. Using zend_hash_get_current_data(array, (void**) &data); I copy the value 23 into data. Then I convert it to long, if the value is not a long already: convert_to_long(*data); And now I move the pointer to the position where the genre ID is stored: php_stream_seek(stream, ID3_SEEK_V1_GENRE, SEEK_END); 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. If I return RETURN_LONG(Z_LVAL_P(*data); I get 23 as expected. Hope anybody is able to help or direct me to the correct mailinglist if internals is not the appropriate list. Best regards, Stephan