[Gambas-user] Can Gambas run itself? Fixed!
Kchula-Rrit
kchularrit at ...734...
Fri Dec 23 09:00:40 CET 2005
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.
More information about the User
mailing list