W3C home > Mailing lists > Public > xproc-dev@w3.org > June 2009


From: Norman Walsh <ndw@nwalsh.com>
Date: Thu, 04 Jun 2009 07:12:38 -0400
To: XProc Dev <xproc-dev@w3.org>
Message-ID: <m2zlcouuah.fsf@nwalsh.com>
Along the same lines as fileutils, here's a proposal for some osutils:

<p:library xmlns:p="http://www.w3.org/ns/xproc"

<p:documentation xmlns="http://www.w3.org/1999/xhtml">
<h1>OS utils Library</h1>
<h2>Version 1.0</h2>
<p>The steps defined in this library provide information about the
underlying operating system and its environment.

<!-- ============================================================ -->

<p:documentation xmlns="http://www.w3.org/1999/xhtml">
<p>The <code>cxo:info</code> step returns information about the OS
on which the processor is running. It returns a <code>c:result</code> element
with attributes describing properties of the system. It <strong>should</strong>
include the following properties:</p>
<dd>The file separator; usually “/” on Unix, “\” on Windows.</dd>
<dd>The path separator; usually “:” on Unix, “;” on Windows.</dd>
<dd>The operating system architecture, for example “i386”.</dd>
<dd>The name of the operating system, for example “Mac OS X”.</dd>
<dd>The version of the operating system, for example “10.5.6”.</dd>
<dd>The current working directory.</dd>
<dd>The login name of the effective user, for example “ndw”.</dd>
<dd>The home diretory of the effective user, for example “/home/ndw”.</dd>
<p>The exact set of properties returned is implementation-dependent.</p>

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

<!-- ============================================================ -->

<p:documentation xmlns="http://www.w3.org/1999/xhtml">
<p>The <code>cxo:cwd</code> step returns a single <code>c:result</code>
containing the current working directory. On systems which have no
concept of a working directory, this step returns the empty sequence.
<p>(This step is exactly duplicates the <code>cwd</code> attribute on
the <code>c:result</code> from <code>cxo:info</code>; it's just for

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

<!-- ============================================================ -->

<p:documentation xmlns="http://www.w3.org/1999/xhtml">
<p>The <code>cxo:env</code> step returns information about the environment.
It returns a <code>c:result</code> containing zero or more
<code>c:env</code> elements. Each <code>c:env</code> has
<code>name</code> and <code>value</code> attributes containing the name
and value of an environment variable.</p>
<p>On systems which nave no concept of an environment, this step returns
an empty <code>c:result</code>.</p>

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


On XML Calabash, cxo:info returns somethign like this:

   <c:result xmlns:c="http://www.w3.org/ns/xproc-step"
             os-name="Mac OS X"

and cxo:env returns:

   <c:result xmlns:c="http://www.w3.org/ns/xproc-step">
      <c:env name="LANG" value="en_US.UTF-8"/>
      <c:env name="EDITOR" value="emacs"/>
      <c:env name="Apple_PubSub_Socket_Render" value="/tmp/launch-yriAWk/Render"/>
      <c:env name="PWD" value="/projects/src/calabash"/>
      <c:env name="JAVA_ARCH" value="i386"/>
      <c:env name="LOGNAME" value="ndw"/>
      <c:env name="MAIL" value="/var/mail/ndw"/>
      <c:env name="COMMAND_MODE" value="unix2003"/>
      <c:env name="INFOPATH" value="/usr/local/info:/usr/info:/share/info"/>
      <c:env name="JAVA_MAIN_CLASS_556" value="com.xmlcalabash.drivers.Main"/>
      <c:env name="PDFLIBRESOURCE" value="/Users/ndw/.pdflib.upr"/>
      <c:env name="GNUS" value="/Applications/Gnus.app/Contents/MacOS/Emacs"/>

                                        Be seeing you,

Norman Walsh <ndw@nwalsh.com> | It does not do harm to the mystery to
http://nwalsh.com/            | know a little about it. For far more
                              | marvelous is the truth than any artists
                              | of the past imagined!--Richard Feynman

Received on Thursday, 4 June 2009 11:13:37 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:03:05 UTC