system - Maple Help

system

invoke a command in the host operating system

 Calling Sequence system(command) system[launch](command,arguments)

Parameters

 command - string arguments - sequence of strings, and/or small integers

Description

 • The function system passes command to the host operating system which performs the appropriate function.
 The result is the return status of the command performed, which is operating system dependent, but usually 0 indicates success and any other value indicates failure.
 Note: On some operating systems, some operating system commands may not be accessible via this mechanism.
 • The function system[launch] spawns a new process before executing command via Windows' CreateProcess or Unix-style fork/exec system calls.  The given command should specify an application or executable file, not a shell or DOS command.
 The new process, as specified by command and zero or more arguments, is started outside Maple.  The Maple process continues as usual; it does not wait for the new process to finish.
 If an error occurs trying to start the new process, system[launch] may not report any messages as to the cause of the error.
 The specified executable file is searched for in the same set of directories as commands entered on the system command line. This set of directories is determined by the PATH environment variable. If the executable file is not found in one of the directories in PATH, it can still be run by providing the full path to the file.
 system[launch] will return the process id of the spawned process.
 • To disable system calls, the -z option can be used when launching Maple. For more details see maple.

 • The system command is thread-safe as of Maple 15.
 > $\mathrm{system}\left("echo test"\right)$
 > $\mathrm{system}\left[\mathrm{launch}\right]\left("notepad"\right)$
 > $\mathrm{system}\left[\mathrm{launch}\right]\left("xterm","-title","My Title"\right)$