Re: forking a subprocess under scotty

James Song (jsong@nlc.com)
Mon, 10 Mar 97 08:29:40 PST

Another way of starting a process is to use the command open. Well,
I am still using Tcl7.4/Tk4.0. I am not sure the same functionality has been
kept for Tcl7.5/Tk4.1.

To start a process with using open, call open command with: open "|prog args".
The successful execution of the command will return a file descriptor.

--James
> > Hi, everybody !!
> > Does anyone know how can I make fork() in scotty , i. e. I need to
> > call a programm(or tcl script, or something ) from scotty tcl script
> > so that the "farther" script won`t wait till his child returns. A just
> > start some new process working on it's own and continue to do my job
> > in the parent .
> >
> This is more difficult than it seems. Or at least I usually have more
> trouble with it than I expect!
>
> You would think that you could jjust do exec cmd &, but tcl still waits
> for stdout/stderr to close so it can get the result code, I think.
>
> At one job we had to have tk callbacks rsh to another machine and start
> things up. It took a LONG time to get things to work ok. At every
> step, it seemed, we had to redirect stdin/stdout/stderror to/from
> dev null. Sometimes you also have to use an intermediate shell script
> that just starts what you want to do and exits to prevent zombies.
>
> Could be worse. YOu could be using exec under NT. The TCL developers
> said that there were 60 some-odd variations.
>
> Post whatever you get working!
>
> Good luck
> -- cary
> cobrien@access.digex.net
>
> --
> !! This message is brought to you via the `tkined & scotty' mailing list.
> !! Please do not reply to this message to unsubscribe. To subscribe or
> !! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
> !! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.
>

--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.