Re: PHP CLI setting cooked terminal mode

From: Date: Wed, 18 Sep 2013 14:20:53 +0000
Subject: Re: PHP CLI setting cooked terminal mode
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On Wed, Sep 18, 2013 at 04:13:39PM +0200, Remi Collet wrote:
> Le 18/09/2013 16:04, Alain Williams a écrit :
> 
> > What is needed is for this to NOT be called if the standard output is not
> > connected to a tty.
> 
> From your previous message:
> 
> >     ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
> >     ioctl(0, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig icanon echo ...}) = 0
> 
> Which is standard input, not standard output

Yes - a typeo, sorry.

> I can get it to not do this by connecting stdin to /dev/null:
> 
>     ./myScript < /dev/null | less
> 
> qed
> 
> > Should I raise this as a bug ?
> 
> So, I don't think there is any bug there.

The redirection of stdin to /dev/null is NOT a solution. You don't need to do
this with scripts written in other languages (eg shell, perl). It makes using
the script for the end user more difficult and strangely different from scripts
written in other languages.

-- 
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
#include <std_disclaimer.h>


Thread (12 messages)

« previous php.internals (#69195) next »