Re: [PHP4BETA] Standard Features ?
| From: | Stig Bakken | Date: | Thu, 15 Jul 1999 14:09:33 +0000 |
| Subject: | Re: [PHP4BETA] Standard Features ? | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-2030@lists.php.net to get a copy of this message | ||
On Thu, 15 Jul 1999, Sascha Schumann wrote:
> On Thu, Jul 15, 1999 at 12:56:45AM -0400, Rasmus Lerdorf wrote:
> > > I am wondering if PHP4 supports STDIN, STDOUT, STDERR, and if there is a
> > > way to read command line args (ala argc, argv) when php is executed from
> > > the command line.
> >
> > Uhh, argc,argv handling has been available for years. Dating all the way
> > back to early php2 days as far as I recall.
> >
> > And stdout is not an issue of course. stdin/stderr can be access directly
> > by opening /dev/stdin and /dev/stderr or on some operating systems this
> > would be /dev/fd/0 and /dev/fd/2
>
> Well, there is no standard way of accessing std* which is
> guaranteed to work on all platforms. How about adding a new
> handler to fopen-wrappers:
>
> std://in
> std://out
> std://err
>
> That way no namespace pollution of i.e. normal files takes place.
Good idea, however I'd rather see it named like this, to further prevent
namespace pollution.
php:stdin
php:stdout
php:stderr
The "//" is not needed since we're not going to another host to get data.
- Stig