Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:15323 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1812 invoked by uid 1010); 9 Mar 2005 15:23:02 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 1797 invoked from network); 9 Mar 2005 15:23:02 -0000 Received: from unknown (HELO pb1.pair.com) (127.0.0.1) by localhost with SMTP; 9 Mar 2005 15:23:02 -0000 X-Host-Fingerprint: 80.74.107.235 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from ([80.74.107.235:47254] helo=mail.zend.com) by pb1.pair.com (ecelerity HEAD r(5124)) with SMTP id 21/37-53294-5D41F224 for ; Wed, 09 Mar 2005 10:23:02 -0500 Received: (qmail 30989 invoked from network); 9 Mar 2005 15:22:58 -0000 Received: from shire.zend.office (10.1.2.160) by internal.zend.office with SMTP; 9 Mar 2005 15:22:58 -0000 Date: Wed, 9 Mar 2005 17:22:58 +0200 (IST) X-X-Sender: frodo@shire.zend.office To: Wez Furlong cc: PHP Development In-Reply-To: <4e89b4260503090718503f9a5@mail.gmail.com> Message-ID: References: <4e89b4260503090718503f9a5@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] zend_stream_fixup From: stas@zend.com (Stanislav Malyshev) WF>>The idea is that the zend engine should only call the functions in WF>>zend_stream.c to access the script input. The fixup function is But file_handle is not used only for input. There are a lof of other things that can be done with handle. Getting stat, for example, or seeking. It's possible to do it with FILE * and with php_stream, but not with the result of the fixup function. Actually, after fixup function it is impossible to do anything but read and close with the handle. I think it's very wrong. WF>>designed to promote FILE* or file descriptors up to something WF>>compatible with its stdio stream reading functions. Filenames are WF>>handed out to PHP and opened up using the streams layer. WF>> WF>>The rule for the fixup function is that it either errors out, or sets WF>>up the zend_file_handle so that zend_stream_XXX functions will work. But this means if you get a file handle which is ZEND_HANDLE_STREAM, you cannot use it as a stream - it might be result of stream open, in which case handle is php_stream *, or result of fixup, in which case is't FILE *. Don't you think it's wrong? -- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115