|
Re: Cross-platform exec()
>perhaps system(), but I'm not sure if I should use it.
Depends on what you need. system() pauses your program, opens a new shell, and executes the command you give it in its argument. When the program finishes executing, it will exit, the shell will close, and your program will resume execution.
popen, like titaniumdecoy mentioned, is for opening a pipe to a program. That is, it'll execute a program, and then you can use the pipe it's opened to communicate with the other process. In other words, your program isn't halted until the process is done (like system()).
Last edited by Sorrofix; Jun 8th, 2008 at 4:28 PM.
|