Executes a child process, similar to clCmd and clSystem. However, for both UNIX and Windows, the behavior of clExec is to run without a command processor (/usr/bin/sh or cmd.exe). For each platform, the child process is executed directly.
If you need functionality, such as wildcard expansion
or redirection of input or output, use clCmd because
the command line must not include anything a command processor provides.
If it does, the function may not behave as designed.
int clExec(string command)
Parameter |
Description |
---|---|
command |
String of the full command line for the child process you want to start. Do not include any command processor features (wildcard expansion, redirection, and so on). If you need command processor features, use clCmd instead. |
Integer.
Returns the 8-bit exit status of the command line program for success.
On UNIX, returns the negative value of the UNIX error number (as documented in the UNIX errno.h file, and on Windows, returns the 8-bit exit status of the command line program for failures.
string exec_command;
int rv;
exec_command = "/usr/local/stuff/myprog arg1 arg2";
rv = clExec(exec_command);
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |