Changes

Jump to navigation Jump to search
40 bytes removed ,  16:19, 27 February 2020
no edit summary
=Conventions=
 
{{Mark|Updated with Version 9.0:}}
All functions and errors in this module are assigned to the <code><nowiki>http://basex.org/modules/proc</nowiki></code> namespace, which is statically bound to the {{Code|proc}} prefix.<br/>
==proc:system==
 
{{Mark|Updated with Version 9.0:}} new {{Code|input}} option; revised error handling.
{| width='100%'
* {{Code|proc:system('date')}} returns the current date on a Linux system.
* Analyses the given input and counts the number of lines, words and characters (provided that {{Code|wc}} is available on the system):
<pre classsyntaxhighlight lang="brush:xquery">
proc:system(
'wc', (),
map { 'input': 'A B' || out:nl() || 'C' }
)
</presyntaxhighlight>* The following example returns "Command “Command not found" found” (unless {{Code|xyz}} is a valid command on the system):<pre classsyntaxhighlight lang="brush:xquery">
try {
proc:system('xyz')
} catch proc:* error { 'Command not found.: '|| $err:description
}
</presyntaxhighlight>
|}
* Instead of the {{Code|proc:code....}} error, the error message will be assigned to the returned element (no process code will be returned).
The result has the following structure:
<pre classsyntaxhighlight lang="brush:xml">
<result>
<output>...output...</output>
<code>...process code...</code>
</result>
</presyntaxhighlight>
|-
|'''Errors'''
==proc:fork==
 
{{Mark|Introduced with Version 9.0:}}
{| width='100%'
| '''Examples'''
|
* {{Code|proc:property('java.class.path')}} returns the full user class path.
* {{Code|map:merge(proc:property-names() ! map:entry(., proc:property(.)))}} returns a map with all system properties.
|}
=Errors=
 
{{Mark|Updated with Version 9.0:}}
{| class="wikitable" width="100%"
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu