Mail Archives: djgpp/1999/08/18/12:10:30
> The functions, system(), spawn() and exec() are used to execute
> other programs or commands. So what's the difference between them?
system() interprets an entire command line, including pipes,
redirection, etc. It does this by running the command interpreter
(command.com or sh.exe) so there's overhead, but it's flexible.
spawn and exec run one specific binary executable with a specific set
of arguments, which are not interpreted at all. The only difference
between spawn and exec is that spawn returns to the calling program
when the child is done, while exec does not.
- Raw text -