http://www.zorba-xquery.com/modules/process
Module Description
Before using any of the functions below please remember to import the module namespace:
import module namespace process = "http://www.zorba-xquery.com/modules/process";
This module provides functions to create a native process and return the result (i.e. exit code, result on standard out and error). Example:
import module namespace proc = "http://www.zorba-xquery.com/modules/process";
proc:exec("ls")
Potential result:
<result xmlns="http://www.zorba-xquery.com/modules/process"> <stdout>myfile.txt</stout> <stderr/> <exit-code>0</exit-code> </result>
Author:
Cezar Andrei
XQuery version and encoding for this module:
xquery version "3.0" encoding "utf-8";
Module Resources
- the XQuery module can be found here.
Namespaces
| ann | http://www.zorba-xquery.com/annotations |
| process | http://www.zorba-xquery.com/modules/process |
| ver | http://www.zorba-xquery.com/options/versioning |
Function Summary
|
exec
(
$cmd as xs:string
) as element(process:result) external Executes the specified string command in a separate process. |
|
exec
(
$cmd as xs:string,
$args as xs:string*
) as element(process:result) external Executes the specified string command in a separate process. |
Functions
declare %ann:sequential function process:exec (
$cmd as xs:string
) as element(process:result) external
Executes the specified string command in a separate process. This function does not allow arguments to be passed to the command.
Parameters:
- $cmd command to be executed (without arguments)
Returns:
- the result of the execution as an element as shown in the documentation of this module. The exit-code element returns the exit code of the child process.
Errors:
- process:PROC01 if an error occurred while communicating with the executed process.
declare %ann:sequential function process:exec ( $cmd as xs:string, $args as xs:string* ) as element(process:result) external
Executes the specified string command in a separate process. Each of the strings in the sequence passed in as the second argument is passed as an argument to the executed command.
Parameters:
- $cmd command to be executed (without arguments)
- $args the arguments passed to the executed command (e.g. "-la")
Returns:
- the result of the execution as an element as shown in the documentation of this module. The exit-code element returns the exit code of the child process.
Errors:
- process:PROC01 if an error occurred while communicating with the executed process.
blog comments powered by Disqus