Re: How to get UNIX Process ID from within a running 4GL program
Posted in 1999
From: "Mario R. Canto" <mcanto@intec.unl.edu.ar>
>
>Obnoxio The Clown escribis:
> >
> > From: "Tim Lim" <tim_lim@exe.com.au>
> > >
> > >I have a need of get the UNIX process ID of my running 4GL program.
> > >
> > >Anyone has a known answer?
> >
> > It's ugly, but:
> >
> > CREATE TEMP TABLE x (pidno int)> > RUN "echo $$ > /tmp/someuniquename"
> > LOAD FROM /tmp/someuniquename INSERT INTO temptable> >
> > and there you go.
>
>This way you obtain the PID of the child process.
Yes, I already confessed to my shameful stupidity.
>The best way (that I know) without using a C function includded in the
>runner, is:
>
>$ fglgo myprog.4gi $$ # (passing the process Id as first argument)>
>and inside the prog
>...
>INTEGER pid
>...
>LET pid = fgl_argval(1)
arg_val(1)
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com