http://www.zorba-xquery.com/modules/system

Description

Before using any of the functions below please remember to import the module namespace:

import module namespace system = "http://www.zorba-xquery.com/modules/system";
The system module allows developers to access system properties. Part of these system properties are environment variables, local variable to the process running Zorba, and properties defined by Zorba.
To avoid conflicts between environment variables and properties defined by Zorba, all environment variables are prefixed with env..
For instance, the following query:
 import module namespace system = "http://www.zorba-xquery.com/modules/system";
 for $prop in system:properties()
 return concat($prop, ": ", system:property($prop), "
 ")
 

Will output:
 env.TERM_PROGRAM: Apple_Terminal
 ...
 
In this example, it is important to notice that the environnement variable PATH with the key env.PATH.

Author

Markus Pilman

XQuery version and encoding

xquery version "3.0" encoding "utf-8";

Namespaces

anhttp://www.zorba-xquery.com/annotations
systemhttp://www.zorba-xquery.com/modules/system
verhttp://www.zorba-xquery.com/options/versioning

Function Summary

  properties() as xs:string* external

This function retrieves the names of the current system properties.

  property($key as xs:string) as xs:string? external

Gets the system property indicated by the specified key.

Variables

$system:zorba-version-patch as xs:string

Zorba patch version (zorba.version.patch).

$system:zorba-version-minor as xs:string

Zorba minor version (zorba.version.minor).

$system:zorba-version-major as xs:string

Zorba major version (zorba.version.major).

$system:zorba-version as xs:string

Zorba version in the format Major.Minor.Patch (zorba.version).

$system:zorba-module-path as xs:string

The Zorba module path, that is the paths in which Zorba looks for modules (zorba.module.path).

$system:user-name as xs:string

The username, with which this process was started (user.name). On Unix, this variable is only available if the USER environment variable is set (e.g. it might not be available in a cronjob).

$system:linux-distributor-version as xs:string

The version of the Linux distribution, Zorba is running on (linux.distributor.version). Works on UNIX based operating systems only.

$system:linux-distributor as xs:string

The Linux distribution, Zorba is running on (linux.distributor). Works on UNIX based operating systems only.

$system:hardware-manufacturer as xs:string

Gets the hardware manufacturer (hardware.manufacturer).

$system:hardware-virtual-memory as xs:string

Virtual memory available (hardware.virtual.memory).

$system:hardware-physical-memory as xs:string

Physical memory available (hardware.physical.memory).

$system:hardware-logical-per-physical-cpu as xs:string

number of logical per physical processors in the system (hardware.logical.per.physical.cpu). This information is not available under Mac OS X.

$system:hardware-physical-cpu as xs:string

Number of physical processors in the system (hardware.logical.cpu).

$system:hardware-logical-cpu as xs:string

Number of logical processors in the system (hardware.logical.cpu). This information is not available under Mac OS X.

$system:os-is64 as xs:string

True if system architecture is 64bits (os.is64).

$system:os-arch as xs:string

The name of the processor architecture (os.arch). For example x86 or x86_64.

$system:os-version as xs:string

The version of the Operating System.

$system:os-version-version as xs:string

The version of this UNIX installation or an empty string if the process does not run on a UNIX/Linux installation (os.version.version). Works on UNIX based operating systems only.

$system:os-version-release as xs:string

The release of this UNIX installation or an empty string if the process does not run on a UNIX/Linux installation (os.version.release). Works on UNIX based operating systems only.

$system:os-version-build as xs:string

The build number of the Windows installation or an empty string if the process does not run on a Windows installation (os.version.build). Works on Windows only.

$system:os-version-minor as xs:string

The minor version number of the Windows installation or an empty string if the process does not run on a Windows installation (os.version.minor). Works on Windows only.

$system:os-version-major as xs:string

The major version number of the Windows installation or an empty string if the process does not run on a Windows installation (os.version.major). Works on Windows only.

$system:os-node-name as xs:string

The name of the computer the process is running on (os.node.name).

$system:os-name as xs:string

The name of the operating system (os.name).

Functions

properties#0

declare %an:nondeterministic function system:properties() as xs:string* external

This function retrieves the names of the current system properties. This list includes environment variables, local variable to the process running Zorba, and properties defined by Zorba.
To avoid conflicts between environment variables and properties defined by Zorba, all environment variables are prefixed with env..

Returns

  • xs:string*

    List of all system properties.

property#1

declare %an:nondeterministic function system:property(
    $key as xs:string
) as xs:string? external

Gets the system property indicated by the specified key.

Parameters

  • $key as xs:string
    The name of the system property.

Returns

  • xs:string?

    The string value of the system property, or an empty sequence if there is no property with that key.

blog comments powered by Disqus