Re: Additions to PHP_Compat
| From: | Stefan Neufeind | Date: | Wed, 26 May 2004 16:06:08 +0000 |
| Subject: | Re: Additions to PHP_Compat | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-29702@lists.php.net to get a copy of this message | ||
On 26 May 2004 at 14:39, Michael Wallner wrote:
> Could these be added to PHP_Compat?
>
> if (!defined('STDIN')) {
> define('STDIN', fopen('php://stdin', 'r'));
> }
> ---
> if (!defined('STDOUT')) {
> define('STDOUT', fopen('php://stdout', 'w'));
> }
> ---
> if (!defined('STDERR')) {
> define('STDERR', fopen('php://stderr', 'w'));
> }
If you use it in a program that e.g. does multiple writes to STDOUT,
am I wrong that this would open the file again and again for each of
the output-calls, resulting in many open files and never (until
script end) closing any of these? Or do these calls always return the
same handler to the stdout etc. (not tested)?
Stefan