🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Lattice C

#10595
From: Michael
Date: Tue, 13 Dec 1988 23:30
37 lines
1562 bytes
In article <4197@hcr.UUCP> morgan@hcr.UUCP (Morgan Jones) writes:
>In article <6013@killer.DALLAS.TX.US> jdp@killer.UUCP writes:
>>Also, does the Unix (tm) function system() return to the caller when the
>>external program is completed?
>
>int
>system(cmd)
>	char *cmd;
>{
>	if (cmd == "" || cmd == NULL)
>		Execute("",Input(),0L);
>	else
>		Execute("",0L,0L);
>	return(0);
>}

no no no.
First, system takes a cmd arg. I know the above is wrong because it isn't
even using cmd.

In answer to the question about unix, it does return when the called
program returns. So, a better approach would be

		Execute (cmd, Input(), Output());

is closer. Problems: If cmd == NULL, Execute will start a shell,
system() does nothing. If you are from Workbench, I don't think
Input() and Output() are defined (might be NULL, which is OK; might be
garbage, which is not). 

I thought I remembered another difference between system and Execute,
but I can't think of it offhand.
			Michael
: --- 
: Michael Gersten			 uunet.uu.net!stb!michael
:					crash!gryphon!denwa!stb!michael
: Coff Coff <=== Stop smoking.
Technical Details
Message-ID: <10635@stb.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-lcc!ames!pacbell!ditka!stb!michael
References: <6013@killer.DALLAS.TX.US> <4197@hcr.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-lcc!ames!pacbell!ditka!stb!michael
From: michael@stb.UUCP (Michael)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Lattice C
Keywords: Amiga Lattice C functions Unix
Message-ID: <10635@stb.UUCP>
Date: 13 Dec 88 23:30:26 GMT
References: <6013@killer.DALLAS.TX.US> <4197@hcr.UUCP>
Reply-To: michael@stb.UUCP (Michael)
Organization: STB BBS, La, Ca, Usa, +1 213 459 7231
Lines: 36