|
|||||
|
||||||
Other Library Functions |
function |
execute |
Library: Process execution (OMPROCESS)
Import: omprocess.xmd |
Return type: Integer Returns: The return code generated by executing the specified process |
export integer function execute value command-line-type command-line in-directory value string initial-directory optional stdin value string source stdin optional stdout value string sink stdout optional stderr value string sink stderr optional environment read-only string environment optional
Argument definitions
The execute
function launches the execution of a program external to OmniMark, using the provided command-line. The program is fed its
input from the stdin argument; the stdout argument can be used to process the output generated by the program. Similarly, the stderr argument can be used to process the error stream from the program. If stdin is not specified, it defaults to an empty string, whereas if either or both of stdout and stderr are not specified, they default to #suppress
.
The environment shelf is used to specify a set of environment variables that are provided to the process when it is launched. The value of each item on the environment shelf should have the form
NAME=VALUEwhere
VALUE
may be a zero-length string. The shelf item keys are not used, and need not be set to anything. On both Unix and Windows platforms, the ENVIRONMENT shelf represents the entire environment
variable space of the process: its items are not merged with any
pre-existing environment variables. In the case where any pre-existing
environment variables should be preserved, the following procedure
should be followed:
import "omutil.xmd" prefixed by util. process local string environment variable repeat over util.environment as e set new environment to key of e || "=" || e again ; Add any additional environment variables.
Following this, the local shelf environment will contain the appropriately-merged set of environment variables, and can be passed to the execute
function.
When the execute
function terminates, its value is the return code
provided by the execution of the program.
The following exceptions may occur:
Other Library Functions |
Copyright © Stilo International plc, 1988-2010.