[Gambas-user] Can Gambas run itself? Fixed!

Benoit Minisini gambas at ...1...
Fri Dec 23 13:21:47 CET 2005


On Friday 23 December 2005 09:00, Kchula-Rrit wrote:
> On Thursday December 22 2005 04:13 pm, Benoit Minisini wrote:
> > On Thursday 22 December 2005 08:55, Kchula-Rrit wrote:
> > > 	I'm trying to get a Gambas2 program to run another copy of itself but
> > > am having problems.  I'm trying to have the main program send commands
> > > into a file, which the second program reads with a "tail -f" command. 
> > > The main program receives command-responses with its own "tail -f"
> > > command.
>
> 	Neither adding WRITE to the OPEN statement, nor adding FLUSH after print
> #outfile statements worked.  It finally worked when I redirected the SHELL
> command's standard-input to /dev/null:
>
> Original, didn't work:
> > >      . Run second program...
> > >      Second2Main = SHELL "gbx2 secondprog" FOR READ WRITE
>
> This made it work:
>       ' Run second program...
>       Second2Main = SHELL "gbx2 secondprog < /dev/null" FOR READ WRITE
>
> >	...
> > When you open a file, by default input/output are buffered.
> >
> > Try to use the FLUSH instruction after PRINT, or adds the WRITE keyword
> > before CREATE to your OPEN statements.
>
>      Thanks for the ideas.
>
> K-R.
>

Instead of redirecting to "/dev/null", can you try the two following things 
too?

* Replace SHELL by EXEC.
* Use SHELL, but without the WRITE keyword.

Thanks in advance.

Regards,

-- 
Benoit Minisini





More information about the User mailing list