This is archive.exproc.org

eXProc.org

Proposed OS Utilities

This page collects proposed extension steps. Implementation welcome, but contents subject to change at any time.

These steps are in the “proposed OS extension namespace”, http://exproc.org/proposed/steps/os, identified by the prefix “pos”.

pos:info

Returns information about the operating system.

<p:declare-step type="pos:info">
     <p:output port="result"/>
</p:declare-step>

The pos:info step returns information about the operating system on which the processor is running. It returns a c:result element with attributes describing properties of the system. It should include the following properties:

file-separator

The file separator; usually “/” on Unix, “\” on Windows.

path-separator

The path separator; usually “:” on Unix, “;” on Windows.

os-architecture

The operating system architecture, for example “i386”.

os-name

The name of the operating system, for example “Mac OS X”.

os-version

The version of the operating system, for example “10.5.6”.

cwd

The current working directory.

user-name

The login name of the effective user, for example “ndw”.

user-home

The home diretory of the effective user, for example “/home/ndw”.

The exact set of properties returned is implementation-dependent.

pos:cwd

Returns the current working directory of the processor.

<p:declare-step type="pos:cwd">
     <p:output port="result" sequence="true"/>
</p:declare-step>

The pos:cwd step returns a single c:result containing the current working directory. On systems which have no concept of a working directory, this step returns the empty sequence.

(This step is exactly duplicates the cwd attribute on the c:result from pos:info; it's just for convenience.)

pos:env

Returns information about the environment

<p:declare-step type="pos:env">
     <p:output port="result"/>
</p:declare-step>

The pos:env step returns information about the operating system environment. It returns a c:result containing zero or more c:env elements. Each c:env has name and value attributes containing the name and value of an environment variable.

On systems which nave no concept of an environment, this step returns an empty c:result.