Programming Guide |
Executes a system call
int sm_shell(char *cmdstr, int wait);
cmdstr
- The operating system command to execute; its syntax is system-dependent.
wait
- Used only in character mode, specifies whether to display an acknowledgement message before returning to the Panther application:
- 1 (Yes): Display a message that the user must acknowledge before the Panther application resumes execution.
- System-dependent.
In character mode,
sm_shell
clears the screen and displays any output from the specified program; on GUI platforms, display output is system-dependent.Return values are system-dependent. For example, UNIX systems typically supply
sm_shell
with the executed command's return value and reason for exiting by shifting and OR'ing two values together; under Windows, the WinExec Windows API function is used and a return value greater than 31 indicates success.On Windows, the command string must contain a filename. For example, to run batch files, specify the file extension, as in
run.bat
. To generate a directory listing using thedir
command, specify:command.com /c dir
# On a UNIX system, check a directory listing.
call sm_shell("ls -l", 1)
#open a file...