Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > e3d62627d1d1aab7ab1be2dd7f65a872 > files > 343

ecl-10.4.1-1.fc14.x86_64.rpm

<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>ext:system</title><link rel="stylesheet" href="ecl.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="The ECL manual"><link rel="up" href="ch17s03.html" title="2.3.&#160;OS Reference"><link rel="prev" href="re11.html" title="ext:run-program"><link rel="next" href="ch18.html" title="Chapter&#160;3.&#160;Foreign Function Interface"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><code class="function">ext:system</code></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="re11.html">Prev</a>&#160;</td><th width="60%" align="center">2.3.&#160;OS Reference</th><td width="20%" align="right">&#160;<a accesskey="n" href="ch18.html">Next</a></td></tr></table><hr></div><div class="refentry" title="ext:system"><a name="ref.system"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p><code class="function">ext:system</code> &#8212; Invoke a command using the shell.</p></div><div class="refsynopsisdiv" title="Function"><h2>Function</h2><div class="funcsynopsis"><p><code class="funcdef">(ext:system</code> <var class="pdparam">command</var>)</p></div><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="replaceable"><code>command</code></em></span></p></td><td><p>A string</p></td></tr><tr><td><p><span class="term">returns</span></p></td><td><p>An integer (0-255) with the exit code of the
     program</p></td></tr></tbody></table></div></div><div class="refsect1" title="Description"><a name="id654765"></a><h2>Description</h2><p>This function executes a command in the shell. In Unix systems,
   typically the environment variable <span class="symbol">SHELL</span> determines which
   program will be invoked, while in Windows <span class="command"><strong>CMD.EXE</strong></span> is
   used. The string may thus be any valid command that the shell accepts and
   in can contain higher level elements such as input/output
   redirection.</p><p>As an example, the following function uses an external editor to
   modify a lisp file and, if successful, loads the changed sources:</p><pre class="programlisting">
(defun edit (filename)
  (let* ((editor #+windows "notepad.exe"
                 #-windows "/usr/bin/emacs")
    (command (concatenate 'string editor " " filename)))
    (when (zerop (ext:system command))
    (load filename))))
   </pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="re11.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="ch17s03.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="ch18.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><code class="function">ext:run-program</code>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Chapter&#160;3.&#160;Foreign Function Interface</td></tr></table></div></body></html>