Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uwm.edu!uwvax!umn-d-ub!umn-cs!thelake!steve From: steve@thelake.UUCP (Steve Yelvington) Newsgroups: comp.lang.c Subject: Re: C-Execute-Command Message-ID: <1103891355263101@thelake.UUCP> Date: 3 Dec 89 19:55:26 GMT References: <1989Dec2.161237.23913@virtech.uucp> <2615@servax0.essex.ac.uk> Reply-To: pwcs.StPaul.GOV!stag!thelake!steve Followup-To: comp.lang.c Organization: Otter Lake Leisure Society (MN-USA) Lines: 34 X-Mailer: UUMAIL/Atari ST/TOS 1.0 X-Member-Of: STdNet, the ST Developers' Network X-Snail-Mail: 1392 Brandlwood, White Bear Lake, MN 55110 USA In article <1989Dec2.161237.23913@virtech.uucp>, cpcahil@virtech.uucp (Conor P. Cahill) writes ... >In article <2615@servax0.essex.ac.uk>, georg@SunLab13.essex.ac.uk (Georgatos G) writes: >> Does anybody know how to call an executable file from >> a c-program ? >> I am using the Unix-CC copiler. >Look up the word execute in the permuted index for you programmers reference >manual. Therein you will find references to the exec(2) manual page. > >If you want to use the simplest interface (but much less efficient and >much more prone to security holes) you can use the system(3) library >call (which for some reason is in the index as "issue a shell command" >when it should be something like "execute commands using the shell" or >some such thing). > >All of the following will perform an "ls -l dir". If you use one of the >exec()s you need to use fork() and wait() to run the program as a sub-process. > A couple of (probably stupid) questions: 1. On the net, I often see (non-code) references to functions with numbers inside the parens, as in system(3) and exec(2). None of the documentation I have uses these numbers. What do they mean, and where do they come from? 2. Can someone explain or (*explain) the differences between the spawn, exec and fork families of process-control functions? K&R 1, Harbison & Steele, and the lesser reference works that I have are of no help on this issue. What does the new standard include? -- Steve Yelvington, up at the lake in Minnesota ... pwcs.StPaul.GOV!stag!thelake!steve (UUCP)