Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47270 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83271 invoked from network); 14 Mar 2010 14:41:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Mar 2010 14:41:31 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 74.125.82.170 mail-wy0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:51716] helo=mail-wy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F1/42-07348-A95FC9B4 for ; Sun, 14 Mar 2010 09:41:30 -0500 Received: by wyb36 with SMTP id 36so468774wyb.29 for ; Sun, 14 Mar 2010 07:41:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=T36tCDyzxJLqJJEJXgchDEWQkRrbf++n27G7u6cB1cg=; b=QGBzRBRgG79dmLM0Lbsq5bKnXXqxk6bMYO8Guw0WUd1xgaQRTBo+KC+iVRYxdgTmZ3 JqtgqEWt6Vsn+k5EjvA+S9G75ovMWzUHsVAiNb777uQ+xbykbXwAa9xya+PTHIeWZ5kj QzLcsCDPCvSj2xZOmuArgOKmwYFfAUIXWTGAQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Ey5RfWuUBFfUgkoKjryPp/8YD3ZjABtz+WrLN8ky2VTqGenH4EatxoPlVveMFpMOLe zZHzhqDAddZWexsD4+X+EH8gDSudn7mtdWxqnz0yu55TlFzHtu9ugZX3FJM7ilsMHHn2 wYWzY0p8Pv470CNmgkUr6/lZ3C134oll/wra8= MIME-Version: 1.0 Received: by 10.216.86.16 with SMTP id v16mr2456504wee.162.1268577687067; Sun, 14 Mar 2010 07:41:27 -0700 (PDT) In-Reply-To: <1268577545.11885.77436.camel@localhost> References: <469956791003132238p4bc841a0sd0c8a09e3ee1b084@mail.gmail.com> <4B9CF2F7.2080905@gmail.com> <1268577545.11885.77436.camel@localhost> Date: Sun, 14 Mar 2010 15:41:27 +0100 Message-ID: To: "M." Cc: PHP Developers Mailing List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Implementing fdopen in PHP From: pierre.php@gmail.com (Pierre Joye) On Sun, Mar 14, 2010 at 3:39 PM, M. wrote: > Hi, > > Le dimanche 14 mars 2010 =E0 15:30 +0100, Keisial a =E9crit : >> Creating a fdopen call is useless, since it needs a previous >> descriptor to >> work from, and all descriptors are equal. Where's that file >> descriptor >> coming >> from? > > When you spawn a new program, you can pass it additionnal descriptors on > top of stdin/stdout/stderr. > > For example look at proc_open(). You can pass more than 3 descriptors, > and communicate if the program is able to use them. > > An alternative on linux is to $fp =3D fopen("/proc/self/fd/3","r+") That's what proc_open does and allows. Cheers, --=20 Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org