🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #1597

Re: fork() (not forkv()!) on Amiga?

#1597
From: Steve Koren
Date: Mon, 09 Oct 1989 21:09
34 lines
1696 bytes
Here's another moderately related question on executing programs.
I need to call a program from within mine.  I've found several ways
to do this:

    1) LoadSeg, CreateProc, UnloadSeg
    2) Lattice forkv() or forkl()
    3) Lattice system()
    4) Execute()

Unfortunately they each seem to have problems.  The Lattice forkv()
call causes a GURU when it tries to execute almost anything in the c:
directory.  It also GURU's on a few other things as well - this
behaviour makes its use unacceptable.

Lattice system() call will not accept input and output file streams
to let me redirect the output or input of a command.

Execute() comes close, but I can find no way to obtain the return code
of the executed command.  The Execute() call itself always returns
-1, and IoErr() always contains zero.  I need to be able to examine the
return code.

LoadSeg, CreateProc, UnloadSeg has no apparent way to pass command line
parameters to a command.  Also, I've heard that it will also crash on
c: programs.

So, how do you do it?  There must be an easy way to execute a program
that won't crash on some programs, and will let you have the return
code back from the command, and lets you redirect I/O.

              - thanks

                  steve (koren@hpfela.HP.COM)
Technical Details
Message-ID: <13920002@hpfelg.HP.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcso!hpfelg!koren
References: <13920001@hpfelg.HP.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcso!hpfelg!koren
From: koren@hpfelg.HP.COM (Steve Koren)
Newsgroups: comp.sys.amiga.tech
Subject: Re: fork() (not forkv()!) on Amiga?
Message-ID: <13920002@hpfelg.HP.COM>
Date: 9 Oct 89 21:09:05 GMT
References: <13920001@hpfelg.HP.COM>
Organization: HP Elec. Design Div. -FtCollins
Lines: 34