Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde!uunet!cs.utexas.edu!natinst!sequoia!rpp386!woody From: woody@rpp386.cactus.org (Woodrow Baker) Newsgroups: comp.unix.wizards Subject: Re: C-Execute-Command Summary: exec again Message-ID: <17406@rpp386.cactus.org> Date: 5 Dec 89 14:35:27 GMT References: <2614@servax0.essex.ac.uk> <17401@rpp386.cactus.org> Organization: River Parishes Programming, Plano, TX Lines: 29 In article <17401@rpp386.cactus.org>, woody@rpp386.cactus.org (Woodrow Baker) writes: > In article <2614@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 compiler. > > > > > > Hgg89. > > Seems that there is a function in most c compilers called execl or execle > or execlp or execv etc that does this nicely. Fork seems to it do it also. > I heard from a lot of people on this one. I think a question deserves an answer regardless of the level of the questioner. Just because this is unix.wizards, is no justification for the tone of some messages that I got and that I have seen posted. I peruse this discussion, because I work in an MS-DOS world, and have a need to learn some about unix. I have a XENIX system at home...on a hard disk...setting on my bookshelf...problably where it will stay for a while, as I can't find tools that even begin to approach what I have in the MS-DOS world, I know, go flame somewhere else.... It turns out that the compiler that I use has a function called fork that DOES NOT make a copy of the calling program. It DOES pass a command line to an external program and invoke it. (either a .com or .exe (ms-dos)) file, and returns control back to the calling program. The compiler is a rather old 'C' compiler, and is apparently not unix compliant. I use the fork function of my compiler in all the versions of the RLL compiler that I maintain and work.