a*****e 发帖数: 92 | 1 I am writing a C++ program on Unix system. I want to call an executable file
in my
program.
It seems that the function system() is designed for calling system command.
Both _spawnl and _exeul only work on NT or Windows.
Which function should I use? Is there such a function in ANSI? If not, how to
solve this problem? |
x******g 发帖数: 3952 | 2 man exec
【在 a*****e 的大作中提到】 : I am writing a C++ program on Unix system. I want to call an executable file : in my : program. : It seems that the function system() is designed for calling system command. : Both _spawnl and _exeul only work on NT or Windows. : Which function should I use? Is there such a function in ANSI? If not, how to : solve this problem?
|
a*****e 发帖数: 92 | 3 Thanks. I will try.
file
command.
to
【在 x******g 的大作中提到】 : man exec
|
c*r 发帖数: 278 | 4 "exec" won't be a "call" to a program, because it won't
return to the original process.
You need to do a fork() then exec() and wait -- basically, what system()
does (system() calls vfork() to be efficient)
Check system() again, it should work. You might forget to give
it the full path of the callee program.
【在 a*****e 的大作中提到】 : Thanks. I will try. : : file : command. : to
|