Re: Implementing fdopen in PHP

From: Date: Sun, 14 Mar 2010 14:39:05 +0000
Subject: Re: Implementing fdopen in PHP
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-47269@lists.php.net to get a copy of this message
Hi,

Le dimanche 14 mars 2010 à 15:30 +0100, Keisial a écrit :
> 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 = fopen("/proc/self/fd/3","r+")


Mark



Thread (6 messages)

« previous php.internals (#47269) next »