由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - How to call a executable file on Unix?
相关主题
请求帮助!!!simple unix question
关于一个C++library的连接how to execute *.exe files?
[转载] recommend good UNIX C programming books?make fortran in UNIX
帮帮忙,用C作一个SHELL问题,急
[转载] Help, about clock().Unix 编成小问题
how to transfer C program run under VC to Unix?急,帮个忙
How to open *.bin files?Help: convert // to /* */ in C code?
how to get rid of the ^M in files?coconut 申请 unix BZ
相关话题的讨论汇总
话题: unix话题: executable话题: system话题: file话题: call
进入Unix版参与讨论
1 (共1页)
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

1 (共1页)
进入Unix版参与讨论
相关主题
coconut 申请 unix BZ[转载] Help, about clock().
[转载] Re: 请问unix下如何编写图形界面how to transfer C program run under VC to Unix?
C++ Help under UNIXHow to open *.bin files?
How to send email in C program.how to get rid of the ^M in files?
请求帮助!!!simple unix question
关于一个C++library的连接how to execute *.exe files?
[转载] recommend good UNIX C programming books?make fortran in UNIX
帮帮忙,用C作一个SHELL问题,急
相关话题的讨论汇总
话题: unix话题: executable话题: system话题: file话题: call