[Gambas-user] Help with SHELL and EXEC

Benoit Minisini gambas at ...1...
Sun Oct 12 14:23:57 CEST 2008


On dimanche 12 octobre 2008, Doriano Blengino wrote:
> Benoit Minisini ha scritto:
>
> May be I am wrong... but it seems to me that you are sometimes critic
> when replying to me. I know, I am more critic than the average users on
> this list, so we are paired...
>

Don't worry, I'm not "critic" at all. It just that talking by e-mail often 
looks like as if people are always critic. And english is not my primary 
language, so I often just fill my answers with information only!

> > On dimanche 12 octobre 2008, Doriano Blengino wrote:
> >> Benoit Minisini ha scritto:
> >>> On dimanche 12 octobre 2008, Doriano Blengino wrote:
> >>>> Kari Laine ha scritto:
> >>>>
> >>>> If you look carefully at the docs about EXEC:
> >>>>
> >>>>   [ _Process_ *=* ] *EXEC* _Command_ [ *WAIT* ] [ *FOR* { { *READ* |
> >>>> *INPUT* } | { *WRITE* | *OUTPUT* } } ] [ *AS* _Name_ ]
> >>>>
> >>>> you'll notice that you can't specify both READ & WRITE --------^
>
> This syntax says you can not specify a couple of words. May be this
> could be better:
>
> Form1:
> [Process=] EXEC Command [ WAIT ] [FOR {READ | WRITE}] [AS Name]
> Form2:
> [Process=] EXEC Command [ WAIT ] [ FOR {INPUT | OUTPUT | {INPUT
> OUTPUT}}] [AS Name]
>
> This takes in account that specifying READ & WRITE does not work, if
> that will be verified.
>
> > Some processes need to be run in a virtual terminal, but most of them
> > don't, and you should not have problems with them.
>
> Don't know anything about that, anyway, I think /usr/bin/tr should be
> one of those which don't need a terminal, being a 'true' filter.
>
> > So please be give more details (i.e. some source code!) when you say that
> > they "just don't work".
>
> I sended the project two messages ago, and you replied to it; probably
> you didn't notice the source code attached.

Probably I forgot it between all the e-mails I try to deal with!

> I send it again; run it; click on the togglebutton, look both at the
> textarea and the gambas console.
> Then stop it, change "INPUT OUTPUT" to "READ WRITE", and run it again.
> That will tell you who is wrong. I may be wrong, because of my old 2.0.0
> version that, by the way, runs smoothlessly and I am in love with... :-)
>
> > Note that processes that don't need virtual terminals, can be run with
> > them without problems. But you are adding a useless heavy layer then!
>
> I have so many books around I can't find that book I was talking about
> (and it was a *big* one! :->), but I am pretty sure that it was
> describing this argument. I am not sure, and I would like to read again,
> but I can remember that it is not so simple to get both stdin & stdout
> from another process.

Indeed. You can look at the source code if you dare. :-) It is in the 
gbx_c_process.c file.

>
> Tell me what your tests say to you - this is very interesting because I
> did not try if that book was true or not.
>
> Regards, and happy coding,
> Doriano

I will look at it.

Regards,

-- 
Benoit Minisini




More information about the User mailing list