On Wed, 31 Oct 2007, Shawn Walker wrote:

> On 31/10/2007, Nikolay Molchanov <[EMAIL PROTECTED]> wrote:
>> I'm not suggesting to change stdio, I'm suggesting to change pkgrm code to 
>> use
>> "read(0, buf, 1);"
>> in loop to read 1 byte from standard input until the end of line or EOF 
>> happens.
>> Basically it is the same loop as it uses to write its questions:
>>
>> 12580:    write(2, " D", 1)                = 1
>> 12580:    write(2, " o", 1)                = 1
>> 12580:    write(2, "  ", 1)                = 1
>> 12580:    write(2, " y", 1)                = 1
>> 12580:    write(2, " o", 1)                = 1
>> 12580:    write(2, " u", 1)                = 1
>> 12580:    write(2, "  ", 1)                = 1
>> ...
>>
>> In this case it will leave the pointer in the input file at the beginning of 
>> next line,
>> so the child process will read from this point.
>
> That seems like a lot of hackery for little benefit.

The whole thing reads a bit like "How do we solve a problem that is ages 
old and must have been solved before ?".

Isn't this exactly what programs like expect were supposed to address / 
allow - remote-control/script things that request user input, aka read 
from stdin ?

FrankH.
_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org

Reply via email to