system
system |
Purpose
Synopsis
procedure system(command:string|text)
Argument
command
|
The command to be executed
|
Example
The following displays the functionality of the
mmsystem module using the program
mosel:
system('mosel -s -c "exam mmsystem"')
Further information
1. The given program is executed directly: if the specified expression is a shell command, it is necessary to call the shell explicitly. For instance to get a directory listing under Windows the command will be
"cmd /C dir".
2. Using this procedure should be avoided in applications that are to be run on different systems because such a call is always system dependent and may not be portable.
3. The generated process inherits the current system environment plus the environment variables modified/created using the
setenv procedure.
4. The default output and error streams of the generated process are redirected to the corresponding Mosel streams. The default input stream is closed.
5. This procedure is included in the published interface of
mmsystem (see Section
Published library functions).
6. When Mosel is running in restricted mode (see Section
mosel command: restricted mode), the restriction
NoExec disables this routine unless the environment variable
MOSEL_EXECPATH
is defined. This variable, used in a similar way as the
PATH environment variable, gives a list of paths than can still be used under the restriction. In addition to directories, the definition of the variable may include paths to executables such that it may directly specify a list of programs. It is also worth noting that no search is performed (
i.e. executables must be given with their full path) and that path expansion is performed a the time of loading
mmsystem relative to the Mosel initial working directory.
7. The command may be preceded by the prefix
"enc:" to specify the encoding of the output streams (see Section
Character encoding of text files).
Module