C-Execute-Command

Woodrow Baker woody at rpp386.cactus.org
Wed Dec 6 01:35:27 AEST 1989


In article <17401 at rpp386.cactus.org>, woody at rpp386.cactus.org (Woodrow Baker) writes:
> In article <2614 at servax0.essex.ac.uk>, georg at 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.



More information about the Comp.unix.wizards mailing list