Changes

Jump to navigation Jump to search
607 bytes added ,  13:49, 21 April 2017
|-
| '''Summary'''
|Executes the specified command in a separate process and returns the result as element. {{Code|$cmd}} is the name of the command, and arguments to the command may be specified via {{Code|$args}}.The same {{Code|$options}} parameter contains process optionsare allowed as for [[#proc:* {{Codesystem|encoding}}: convert result to the specified encoding. If no encoding is supplied, the system’s default encoding is used.* {{Code|timeout}}: abort process execution after the specified number of seconds.* {{Code|dir}}proc: process command in the specified directorysystem]].<br/>
A result has the following structure:
<pre class="brush:xml">
* {{Code|proc:execute('dir', '\')}} returns the files of the root directory of a Windows system.
* {{Code|proc:execute('ls', ('-l', '-a'))}} executes the {{Code|ls -la}} command on Unix systems.
|}
 
==proc:fork==
 
{{Mark|Introduced with Version 8.7:}}
 
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|proc:fork|$cmd as xs:string|element(result)}}<br/>{{Func|proc:fork|$cmd as xs:string, $args as xs:string*|element(result)}}<br/>{{Func|proc:fork|$cmd as xs:string, $args as xs:string*, $options as map(xs:string, xs:string)|element(result)}}
|-
| '''Summary'''
|Executes the specified command and ignores the result. {{Code|$cmd}} is the name of the command, and arguments to the command may be specified via {{Code|$args}}. The same {{Code|$options}} are allowed as for [[#proc:system|proc:system]] (but the encoding will be ignored).
|-
|'''Errors'''
|{{Error|BXPR9999|#Error}} the specified encoding does not exist or is not supported.
|-
| '''Examples'''
|
* {{Code|proc:fork('sleep', '5')}}: sleep for 5 seconds (no one should notice).
|}
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu