Sophie

Sophie

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

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>11.2.&#160;Wild pathnames and matching</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="ch11.html" title="Chapter&#160;11.&#160;Pathnames"><link rel="prev" href="ch11.html" title="Chapter&#160;11.&#160;Pathnames"><link rel="next" href="ch12.html" title="Chapter&#160;12.&#160;Files"></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">11.2.&#160;Wild pathnames and matching</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch11.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;11.&#160;Pathnames</th><td width="20%" align="right">&#160;<a accesskey="n" href="ch12.html">Next</a></td></tr></table><hr></div><div class="section" title="11.2.&#160;Wild pathnames and matching"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sec.ansi.pathnames.wild"></a>11.2.&#160;Wild pathnames and matching</h2></div></div></div><p><span class="application">ECL</span> accepts four kind of wildcards in pathnames.</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>A single wildcard in a directory component, file name, type or
    version is parsed as the <span class="symbol">:WILD</span> value. See for instance
    <code class="literal">"*.*"</code>, <code class="literal">"/home/*/.bashrc"</code>, etc</p></li><li class="listitem"><p>A double wildcard in a directory component, such as in
    <code class="literal">"/home/**/"</code> is parsed as the
    <span class="symbol">:WILD-INFERIORS</span>, and matches any number of directories,
    even nested ones, such as: <code class="filename">/home/</code>,
    <code class="filename">/home/jlr</code>, <code class="filename">/home/jlr/lib</code>,
    etc.</p></li><li class="listitem"><p>An isolated wildcard <code class="literal">"log*.txt"</code> matches any number
    of characters: <code class="filename">log.txt</code>,
    <code class="filename">log_back.txt</code>, etc.</p></li><li class="listitem"><p>A question mark <code class="literal">"log?.txt"</code> matches a single
    character: <code class="filename">log1.txt</code>,
    <code class="filename">log2.txt</code>...</p></li></ul></div><p>The matching rules in Common Lisp and <span class="application">ECL</span> are simple but have some
  unintuitive consequences when compared to Unix/DOS rules. The most important
  one is that directories must always end with a trailing slash
  <code class="literal">/</code>. Second to that, <span class="symbol">NIL</span> values can only be
  matched by <span class="symbol">NIL</span> and <span class="symbol">:WILD</span>. Hence,
  <code class="literal">"*"</code> can only match files without file type. For some
  examples see <a class="xref" href="ch12s02.html#sec.ansi.files.directory" title="12.2.1.&#160;DIRECTORY">Section&#160;12.2.1</a>.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch11.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="ch11.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="ch12.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&#160;11.&#160;Pathnames&#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;12.&#160;Files</td></tr></table></div></body></html>