1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291
|
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <title>Pathname-Utils</title> <meta name="viewport" content="width=device-width"> <meta name="description" content="A collection of utilities for pathname manipulation."> <meta name="author" content="Nicolas Hafner <shinmera@tymoon.eu>"> <style type="text/css"> body{
max-width: 1024px;
margin: 0 auto 0 auto;
font-family: sans-serif;
color: #333333;
font-size: 14pt;
padding: 5px;
}
body>header{
display:flex;
align-items: center;
justify-content: center;
flex-direction: column;
max-width: 100%;
text-align: center;
}
body>header img{
max-width: 50%;
}
img{
max-width: 100%;
max-height: 100%;
}
code{
font-family: Consolas, Inconsolata, monospace;
}
a{
text-decoration: none;
color: #0055AA;
}
a img{
border: none;
}
#documentation{
text-align: justify;
}
#documentation pre{
margin-left: 20px;
overflow: auto;
}
#documentation img{
margin: 5px;
}
#symbol-index>ul{
list-style: none;
padding: 0;
}
#symbol-index .package>ul{
list-style: none;
padding: 0 0 0 10px;
}
#symbol-index .package .nicknames{
font-weight: normal;
}
#symbol-index .package h4{
display: inline-block;
margin: 0;
}
#symbol-index .package article{
margin: 0 0 15px 0;
}
#symbol-index .package article header{
font-size: 1.2em;
font-weight: normal;
}
#symbol-index .package .name{
margin-right: 5px;
}
#symbol-index .package .docstring{
margin: 0 0 0 15px;
white-space: pre-wrap;
font-size: 12pt;
}
@media (max-width: 800px){
body{font-size: 12pt;}
} </style> </head> <body> <header> <h1>pathname-utils</h1> <span class="version">1.1.0</span> <p class="description">A collection of utilities for pathname manipulation.</p> </header> <main> <article id="documentation"> <div><h2 id="about_pathname-utils">About Pathname-Utils</h2> <p>This is a collection of common tests and operations to help handling pathnames. It does not actually deal in handling the accessing of files on the underlying system however.</p> <h2 id="how_to">How To</h2> <p>Since this is a purely utility/toolkit library, simply having a look at the symbol index should give you the best idea of what is offered.</p> </div> </article> <article id="copyright"> <h2>Copyright</h2> <span>pathname-utils</span> is licensed under the <span><a href="https://tldrlegal.com/search?q=Artistic">Artistic</a></span> license. © <span>Nicolas Hafner <shinmera@tymoon.eu></span> . This library can be obtained on <a href="https://github.com/Shinmera/pathname-utils">https://github.com/Shinmera/pathname-utils</a>. </article> <article id="symbol-index"> <h2>Package Index</h2> <ul><li class="package"> <h3> <a name="PATHNAME-UTILS" href="#PATHNAME-UTILS">PATHNAME-UTILS</a> <span class="nicknames">(ORG.SHIRAKUMO.PATHNAME-UTILS)</span> </h3> <ul><li> <a name="PATHNAME-UTILS:*WILD-COMPONENT*"> </a> <article id="SPECIAL PATHNAME-UTILS:*WILD-COMPONENT*"> <header class="special"> <span class="type">special</span> <h4 class="name"><code><a href="#SPECIAL%20PATHNAME-UTILS%3A%2AWILD-COMPONENT%2A">*WILD-COMPONENT*</a></code></h4> </header> <div class="docstring"><pre>The proper value to use for a wild pathname component.</pre></div> </article> </li><li> <a name="PATHNAME-UTILS:*WILD-DIRECTORY*"> </a> <article id="SPECIAL PATHNAME-UTILS:*WILD-DIRECTORY*"> <header class="special"> <span class="type">special</span> <h4 class="name"><code><a href="#SPECIAL%20PATHNAME-UTILS%3A%2AWILD-DIRECTORY%2A">*WILD-DIRECTORY*</a></code></h4> </header> <div class="docstring"><pre>A pathname that is wild in its directory spec (can match any directory).</pre></div> </article> </li><li> <a name="PATHNAME-UTILS:*WILD-FILE*"> </a> <article id="SPECIAL PATHNAME-UTILS:*WILD-FILE*"> <header class="special"> <span class="type">special</span> <h4 class="name"><code><a href="#SPECIAL%20PATHNAME-UTILS%3A%2AWILD-FILE%2A">*WILD-FILE*</a></code></h4> </header> <div class="docstring"><pre>A pathname that is wild in its file spec (can match any file).</pre></div> </article> </li><li> <a name="PATHNAME-UTILS:*WILD-INFERIORS*"> </a> <article id="SPECIAL PATHNAME-UTILS:*WILD-INFERIORS*"> <header class="special"> <span class="type">special</span> <h4 class="name"><code><a href="#SPECIAL%20PATHNAME-UTILS%3A%2AWILD-INFERIORS%2A">*WILD-INFERIORS*</a></code></h4> </header> <div class="docstring"><pre>A pathname that has wild inferiors (can match any number of subdirectories).</pre></div> </article> </li><li> <a name="PATHNAME-UTILS:*WILD-INFERIORS-COMPONENT*"> </a> <article id="SPECIAL PATHNAME-UTILS:*WILD-INFERIORS-COMPONENT*"> <header class="special"> <span class="type">special</span> <h4 class="name"><code><a href="#SPECIAL%20PATHNAME-UTILS%3A%2AWILD-INFERIORS-COMPONENT%2A">*WILD-INFERIORS-COMPONENT*</a></code></h4> </header> <div class="docstring"><pre>The proper value to use for a wild inferiors pathname component.</pre></div> </article> </li><li> <a name="PATHNAME-UTILS:*WILD-PATH*"> </a> <article id="SPECIAL PATHNAME-UTILS:*WILD-PATH*"> <header class="special"> <span class="type">special</span> <h4 class="name"><code><a href="#SPECIAL%20PATHNAME-UTILS%3A%2AWILD-PATH%2A">*WILD-PATH*</a></code></h4> </header> <div class="docstring"><pre>A pathname that is wild in both its file and its directory.</pre></div> </article> </li><li> <a name="PATHNAME-UTILS:ABSOLUTE-P"> </a> <article id="FUNCTION PATHNAME-UTILS:ABSOLUTE-P"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3AABSOLUTE-P">ABSOLUTE-P</a></code></h4> <code class="qualifiers"></code> <code class="arguments">PATHNAME</code><code>)</code> </header> <div class="docstring"><pre>Returns the pathname if it is an absolute pathname.
The pathname is coerced using PATHNAME*
See <a href="#PATHNAME-UTILS:PATHNAME*">PATHNAME*</a></pre></div> </article> </li><li> <a name="PATHNAME-UTILS:CLEAN-DIRECTORY-SPEC"> </a> <article id="FUNCTION PATHNAME-UTILS:CLEAN-DIRECTORY-SPEC"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3ACLEAN-DIRECTORY-SPEC">CLEAN-DIRECTORY-SPEC</a></code></h4> <code class="qualifiers"></code> <code class="arguments">DIR</code><code>)</code> </header> <div class="docstring"><pre>Removes superfluous components from the directory spec.
Specifically, if the encountered part is UNSPECIFIC or the
string ".", it is omitted. If the part is :BACK, the
preceding component is omitted if possible. If not possible,
an equivalent amount of :UP specs are inserted instead.</pre></div> </article> </li><li> <a name="PATHNAME-UTILS:COMPONENTS"> </a> <article id="FUNCTION PATHNAME-UTILS:COMPONENTS"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3ACOMPONENTS">COMPONENTS</a></code></h4> <code class="qualifiers"></code> <code class="arguments">PATHNAME</code><code>)</code> </header> <div class="docstring"><pre>Returns a plist containing all the components making up the given pathname.
The plist contains the following keys:
:namestring
:truename
:host
:device
:name
:type
:version
:directory
If the pathname has no truename, its value in the plist is NIL.</pre></div> </article> </li><li> <a name="PATHNAME-UTILS:DIRECTORY-NAME"> </a> <article id="FUNCTION PATHNAME-UTILS:DIRECTORY-NAME"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3ADIRECTORY-NAME">DIRECTORY-NAME</a></code></h4> <code class="qualifiers"></code> <code class="arguments">PATHNAME</code><code>)</code> </header> <div class="docstring"><pre>Returns the name of the topmost directory in the pathname, if any.
The pathname is coerced using TO-DIRECTORY
See <a href="#PATHNAME-UTILS:TO-DIRECTORY">TO-DIRECTORY</a></pre></div> </article> </li><li> <a name="PATHNAME-UTILS:DIRECTORY-P"> </a> <article id="FUNCTION PATHNAME-UTILS:DIRECTORY-P"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3ADIRECTORY-P">DIRECTORY-P</a></code></h4> <code class="qualifiers"></code> <code class="arguments">PATHNAME</code><code>)</code> </header> <div class="docstring"><pre>Returns the pathname if it denotes a directory (not a file).
The pathname is coerced using PATHNAME*
See <a href="#PATHNAME-UTILS:PATHNAME*">PATHNAME*</a></pre></div> </article> </li><li> <a name="PATHNAME-UTILS:DIRECTORY-SEPARATOR"> </a> <article id="FUNCTION PATHNAME-UTILS:DIRECTORY-SEPARATOR"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3ADIRECTORY-SEPARATOR">DIRECTORY-SEPARATOR</a></code></h4> <code class="qualifiers"></code> <code class="arguments">&OPTIONAL (PATHNAME *DEFAULT-PATHNAME-DEFAULTS*)</code><code>)</code> </header> <div class="docstring"><pre>Returns the namestring separator between directories as a string.</pre></div> </article> </li><li> <a name="PATHNAME-UTILS:DOWNWARDS"> </a> <article id="FUNCTION PATHNAME-UTILS:DOWNWARDS"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3ADOWNWARDS">DOWNWARDS</a></code></h4> <code class="qualifiers"></code> <code class="arguments">PATHNAME SUBDIR</code><code>)</code> </header> <div class="docstring"><pre>Moves the topmost pathname component a level downwards.
Specifically, if we have a file "foo/bar.jpg", and move it
downwards by "baz", the resulting pathname will be
"foo/baz/bar.jpg". If the pathname is a directory-pathname
then the last directory is moved downwards by one.
See <a href="#PATHNAME-UTILS:SUBDIRECTORY">SUBDIRECTORY</a></pre></div> </article> </li><li> <a name="PATHNAME-UTILS:ENOUGH-PATHNAME"> </a> <article id="FUNCTION PATHNAME-UTILS:ENOUGH-PATHNAME"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3AENOUGH-PATHNAME">ENOUGH-PATHNAME</a></code></h4> <code class="qualifiers"></code> <code class="arguments">SUBPATH BASE</code><code>)</code> </header> <div class="docstring"><pre>Like ENOUGH-NAMESTRING but returns an actual pathname.
The pathname is coerced using PATHNAME*
See <a href="#PATHNAME-UTILS:PATHNAME*">PATHNAME*</a></pre></div> </article> </li><li> <a name="PATHNAME-UTILS:FILE-NAME"> </a> <article id="FUNCTION PATHNAME-UTILS:FILE-NAME"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3AFILE-NAME">FILE-NAME</a></code></h4> <code class="qualifiers"></code> <code class="arguments">PATHNAME</code><code>)</code> </header> <div class="docstring"><pre>Returns the complete file name as it would be used by the OS, if any.</pre></div> </article> </li><li> <a name="PATHNAME-UTILS:FILE-P"> </a> <article id="FUNCTION PATHNAME-UTILS:FILE-P"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3AFILE-P">FILE-P</a></code></h4> <code class="qualifiers"></code> <code class="arguments">PATHNAME</code><code>)</code> </header> <div class="docstring"><pre>Returns the pathname if it denotes a file (not a directory).
The pathname is coerced using PATHNAME*
See <a href="#PATHNAME-UTILS:PATHNAME*">PATHNAME*</a></pre></div> </article> </li><li> <a name="PATHNAME-UTILS:FILE-TYPE"> </a> <article id="FUNCTION PATHNAME-UTILS:FILE-TYPE"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3AFILE-TYPE">FILE-TYPE</a></code></h4> <code class="qualifiers"></code> <code class="arguments">PATHNAME</code><code>)</code> </header> <div class="docstring"><pre>Returns the actual file type.
This is different from PATHNAME-TYPE in the following manner:
If PATHNAME-TYPE is specific, but contains a dot, only the part
after the dot is used as it would indicate the actual file-type
on any recent system. If PATHNAME-TYPE is unspecific, the
PATHNAME-NAME is specific, and it contains a dot, then that last
part is used instead. Otherwise NIL is returned.</pre></div> </article> </li><li> <a name="PATHNAME-UTILS:LOGICAL-P"> </a> <article id="FUNCTION PATHNAME-UTILS:LOGICAL-P"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3ALOGICAL-P">LOGICAL-P</a></code></h4> <code class="qualifiers"></code> <code class="arguments">PATHNAME</code><code>)</code> </header> <div class="docstring"><pre>Returns the pathname if it is a logical pathname.
The pathname is coerced using PATHNAME*
See <a href="#PATHNAME-UTILS:PATHNAME*">PATHNAME*</a></pre></div> </article> </li><li> <a name="PATHNAME-UTILS:NORMALIZE-DIRECTORY-SPEC"> </a> <article id="FUNCTION PATHNAME-UTILS:NORMALIZE-DIRECTORY-SPEC"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3ANORMALIZE-DIRECTORY-SPEC">NORMALIZE-DIRECTORY-SPEC</a></code></h4> <code class="qualifiers"></code> <code class="arguments">DIR</code><code>)</code> </header> <div class="docstring"><pre>Attempts to normalize the directory specification into one as specified by CLHS.
Also cleans the directory spec.
See <a href="NIL">CLEAN-DIRECTORY-SPEC.</a></pre></div> </article> </li><li> <a name="PATHNAME-UTILS:NORMALIZE-PATHNAME"> </a> <article id="FUNCTION PATHNAME-UTILS:NORMALIZE-PATHNAME"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3ANORMALIZE-PATHNAME">NORMALIZE-PATHNAME</a></code></h4> <code class="qualifiers"></code> <code class="arguments">PATHNAME</code><code>)</code> </header> <div class="docstring"><pre>Returns a normalised form of the given pathname.
More specifically, the given object is ensured to be a pathname
using CL:PATHNAME, then turned into a new pathname with the
following properties: an unspecific component is turned into
NIL and the directory component is normalised through
NORMALIZE-DIRECTORY-SPEC.
See <a href="#PATHNAME-UTILS:UNSPECIFIC-P">UNSPECIFIC-P</a>
See <a href="#PATHNAME-UTILS:NORMALIZE-DIRECTORY-SPEC">NORMALIZE-DIRECTORY-SPEC</a></pre></div> </article> </li><li> <a name="PATHNAME-UTILS:PARENT"> </a> <article id="FUNCTION PATHNAME-UTILS:PARENT"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3APARENT">PARENT</a></code></h4> <code class="qualifiers"></code> <code class="arguments">PATHNAME</code><code>)</code> </header> <div class="docstring"><pre>Returns the parent of the pathname.
If the pathname is a directory-pathname, it returns a pathname
that points to the parent thereof, if possible. Specifically,
if the directory is relative and empty, :up is inserted. If
it is absolute and empty, the same pathname is returned. If
it is not empty, then the last component of the directory is
removed. If the pathname is a file pathname, this is equivalent
to TO-DIRECTORY.
The pathname is coerced using PATHNAME*.
If you need to preserve the pathname's file component, consider
using UPWARDS instead.
See <a href="#PATHNAME-UTILS:PATHNAME*">PATHNAME*</a>
See <a href="#PATHNAME-UTILS:TO-DIRECTORY">TO-DIRECTORY</a></pre></div> </article> </li><li> <a name="PATHNAME-UTILS:PATHNAME*"> </a> <article id="FUNCTION PATHNAME-UTILS:PATHNAME*"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3APATHNAME%2A">PATHNAME*</a></code></h4> <code class="qualifiers"></code> <code class="arguments">PATHNAME</code><code>)</code> </header> <div class="docstring"><pre>Ensures that the argument is a pathname.
If a pathname is passed, it is returned verbatim.
If it is anything else, the value is coerced to a pathname using
NORMALIZE-PATHNAME.
See <a href="#PATHNAME-UTILS:NORMALIZE-PATHNAME">NORMALIZE-PATHNAME</a></pre></div> </article> </li><li> <a name="PATHNAME-UTILS:PATHNAME-EQUAL"> </a> <article id="FUNCTION PATHNAME-UTILS:PATHNAME-EQUAL"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3APATHNAME-EQUAL">PATHNAME-EQUAL</a></code></h4> <code class="qualifiers"></code> <code class="arguments">A B</code><code>)</code> </header> <div class="docstring"><pre>Returns T if the two pathnames denote the same file.
Note that this comparison has to access the file system and might
therefore be costly.
First the two pathnames are turned into truenames using TRUENAME
and then compared using PATHNAME=. This should result in a
comparison that returns true in any situation where the two
pathnames really do refer to the same file, but might not look
the same due to symbolic links or similar effects in the file
system.
See <a href="http://l1sp.org/cl/truename">CL:TRUENAME</a>
See <a href="#PATHNAME-UTILS:PATHNAME=">PATHNAME=</a></pre></div> </article> </li><li> <a name="PATHNAME-UTILS:PATHNAME="> </a> <article id="FUNCTION PATHNAME-UTILS:PATHNAME="> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3APATHNAME%3D">PATHNAME=</a></code></h4> <code class="qualifiers"></code> <code class="arguments">A B &KEY (IGNORE-VERSION T)</code><code>)</code> </header> <div class="docstring"><pre>Returns T if the two pathnames are the same.
Note that this comparison is purely based on the pathnames itself
and does not check whether the two might resolve to the same file
on the system.
Relative pathnames are turned into absolute ones by merging them
with *default-pathname-defaults* before being compared.
Each component of the pathnames are compared using EQUAL, but
treating parts that are UNSPECIFIC-P as the same, regardless
of the way in which they might be unspecific.
If IGNORE-VERSION is non-NIL (the default), then the version
component of the pathnames is not compared. This is useful, as it
can be different for pathnames that appear to be the same on some
implementations.
See <a href="#PATHNAME-UTILS:UNSPECIFIC-P">UNSPECIFIC-P</a></pre></div> </article> </li><li> <a name="PATHNAME-UTILS:PHYSICAL-P"> </a> <article id="FUNCTION PATHNAME-UTILS:PHYSICAL-P"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3APHYSICAL-P">PHYSICAL-P</a></code></h4> <code class="qualifiers"></code> <code class="arguments">PATHNAME</code><code>)</code> </header> <div class="docstring"><pre>Returns the pathname if it is a physical pathname.
The pathname is coerced using PATHNAME*
See <a href="#PATHNAME-UTILS:PATHNAME*">PATHNAME*</a></pre></div> </article> </li><li> <a name="PATHNAME-UTILS:POP-DIRECTORY"> </a> <article id="FUNCTION PATHNAME-UTILS:POP-DIRECTORY"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3APOP-DIRECTORY">POP-DIRECTORY</a></code></h4> <code class="qualifiers"></code> <code class="arguments">PATHNAME</code><code>)</code> </header> <div class="docstring"><pre>Pops the last component off the pathname-directory part.
The pathname is coerced using PATHNAME*.
Note that this will probably not behave as expected for
pathnames containing :back and :up. For the "intuitive"
behaviour to ascend pathnames, see PARENT or UPWARDS.
See <a href="#PATHNAME-UTILS:PATHNAME*">PATHNAME*</a></pre></div> </article> </li><li> <a name="PATHNAME-UTILS:RELATIVE-P"> </a> <article id="FUNCTION PATHNAME-UTILS:RELATIVE-P"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3ARELATIVE-P">RELATIVE-P</a></code></h4> <code class="qualifiers"></code> <code class="arguments">PATHNAME</code><code>)</code> </header> <div class="docstring"><pre>Returns the pathname if it is a relative pathname.
The pathname is coerced using PATHNAME*
See <a href="#PATHNAME-UTILS:PATHNAME*">PATHNAME*</a></pre></div> </article> </li><li> <a name="PATHNAME-UTILS:RELATIVE-PATHNAME"> </a> <article id="FUNCTION PATHNAME-UTILS:RELATIVE-PATHNAME"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3ARELATIVE-PATHNAME">RELATIVE-PATHNAME</a></code></h4> <code class="qualifiers"></code> <code class="arguments">FROM TO</code><code>)</code> </header> <div class="docstring"><pre>Computes a relative pathname from one place to another.
The pathnames are first turned into absolute ones by
MERGE-PATHNAMES. Then, the common directory components are
eliminated, leftover directory components on the from path
are converted into :up, and finally the remaining components
of the to path are appended, producing the final directory
component. The name, type, and version are taken from the to
pathname.
If the two pathnames differ in device or host, an error is
signalled instead.
The pathnames are coerced using NORMALIZE-PATHNAME after the
merge.
See <a href="#PATHNAME-UTILS:NORMALIZE-PATHNAME">NORMALIZE-PATHNAME</a></pre></div> </article> </li><li> <a name="PATHNAME-UTILS:ROOT-P"> </a> <article id="FUNCTION PATHNAME-UTILS:ROOT-P"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3AROOT-P">ROOT-P</a></code></h4> <code class="qualifiers"></code> <code class="arguments">PATHNAME</code><code>)</code> </header> <div class="docstring"><pre>Returns the pathname if it denotes an absolute root directory.
The pathname is coerced using PATHNAME*
See <a href="#PATHNAME-UTILS:PATHNAME*">PATHNAME*</a></pre></div> </article> </li><li> <a name="PATHNAME-UTILS:SUBDIRECTORY"> </a> <article id="FUNCTION PATHNAME-UTILS:SUBDIRECTORY"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3ASUBDIRECTORY">SUBDIRECTORY</a></code></h4> <code class="qualifiers"></code> <code class="arguments">PATHNAME &REST SUBDIRS</code><code>)</code> </header> <div class="docstring"><pre>Returns a directory-pathname with the given subdirectories appended.
For example, appending "bar" and "baz" to "foo/" will
result in "foo/bar/baz/".
The PATHNAME is coerced using TO-DIRECTORY. For any of the
subdirs, if it is a pathname, stream, or keyword, it is coerced
to a pathname using TO-DIRECTORY. If it is a string, it is
coerced using TO-DIRECTORY but with a trailing slash appended.
If you need to preserve the pathname's file component, consider
using DOWNWARDS instead.
See <a href="#PATHNAME-UTILS:TO-DIRECTORY">TO-DIRECTORY</a></pre></div> </article> </li><li> <a name="PATHNAME-UTILS:SUBPATH-P"> </a> <article id="FUNCTION PATHNAME-UTILS:SUBPATH-P"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3ASUBPATH-P">SUBPATH-P</a></code></h4> <code class="qualifiers"></code> <code class="arguments">SUBPATH BASE &OPTIONAL (ROOT BASE)</code><code>)</code> </header> <div class="docstring"><pre>Returns true if SUBPATH denotes a path on a lower level than BASE.
A pathname is considered a subpath of a base pathname if all of
the following are true:
- Their hosts match
- Their devices match
- The base's name is null or their names match
- The base's type is null or their types match
- The directory component of the subpath denotes a subdirectory
of the directory component of the base.
If the subpath or base are relative pathnames, they are made
absolute by merging them with the root pathname. If the root
pathname is relative, an error is signalled.
The actually returned value is the coerced value of SUBPATH by
NORMALIZE-PATHNAME.
See <a href="#PATHNAME-UTILS:NORMALIZE-PATHNAME">NORMALIZE-PATHNAME</a></pre></div> </article> </li><li> <a name="PATHNAME-UTILS:TO-DIRECTORY"> </a> <article id="FUNCTION PATHNAME-UTILS:TO-DIRECTORY"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3ATO-DIRECTORY">TO-DIRECTORY</a></code></h4> <code class="qualifiers"></code> <code class="arguments">PATHNAME</code><code>)</code> </header> <div class="docstring"><pre>Turns the pathname into a pathname-directory if it is not already one.
If the argument is :UP or :BACK, it is turned into a relative
pathname with the argument as its only pathname-directory-component.
If the argument is :HOME, it is turned into an absolute pathname
pointing to the home directory.
Otherwise the pathname is coerced using PATHNAME*
See <a href="#PATHNAME-UTILS:PATHNAME*">PATHNAME*</a></pre></div> </article> </li><li> <a name="PATHNAME-UTILS:TO-FILE"> </a> <article id="FUNCTION PATHNAME-UTILS:TO-FILE"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3ATO-FILE">TO-FILE</a></code></h4> <code class="qualifiers"></code> <code class="arguments">PATHNAME</code><code>)</code> </header> <div class="docstring"><pre>Turns the pathname into a file pathname.
This means stripping the device, host, and directory components
of the pathname. The given pathname is coerced using PATHNAME*
See <a href="#PATHNAME-UTILS:PATHNAME*">PATHNAME*</a></pre></div> </article> </li><li> <a name="PATHNAME-UTILS:TO-PHYSICAL"> </a> <article id="FUNCTION PATHNAME-UTILS:TO-PHYSICAL"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3ATO-PHYSICAL">TO-PHYSICAL</a></code></h4> <code class="qualifiers"></code> <code class="arguments">PATHNAME</code><code>)</code> </header> <div class="docstring"><pre>Turns the pathname into a physical one if it is not already one.
The pathname is coerced using PATHNAME*
See <a href="#PATHNAME-UTILS:LOGICAL-P">LOGICAL-P</a>
See <a href="http://l1sp.org/cl/translate-logical-pathname">CL:TRANSLATE-LOGICAL-PATHNAME</a>
See <a href="#PATHNAME-UTILS:PATHNAME*">PATHNAME*</a></pre></div> </article> </li><li> <a name="PATHNAME-UTILS:TO-ROOT"> </a> <article id="FUNCTION PATHNAME-UTILS:TO-ROOT"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3ATO-ROOT">TO-ROOT</a></code></h4> <code class="qualifiers"></code> <code class="arguments">PATHNAME</code><code>)</code> </header> <div class="docstring"><pre>Returns the absolute root of the pathname.</pre></div> </article> </li><li> <a name="PATHNAME-UTILS:UNSPECIFIC-P"> </a> <article id="FUNCTION PATHNAME-UTILS:UNSPECIFIC-P"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3AUNSPECIFIC-P">UNSPECIFIC-P</a></code></h4> <code class="qualifiers"></code> <code class="arguments">COMPONENT</code><code>)</code> </header> <div class="docstring"><pre>Returns true if the given component is unspecific.
This includes :UNSPECIFIC, NIL, and the empty string.</pre></div> </article> </li><li> <a name="PATHNAME-UTILS:UPWARDS"> </a> <article id="FUNCTION PATHNAME-UTILS:UPWARDS"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20PATHNAME-UTILS%3AUPWARDS">UPWARDS</a></code></h4> <code class="qualifiers"></code> <code class="arguments">PATHNAME</code><code>)</code> </header> <div class="docstring"><pre>Moves the topmost pathname component a level upwards.
Specifically, if we have a file "foo/bar/baz.jpg", and move
it upwards by one, the resulting pathname will be
"foo/baz.jpg". If the pathname is a directory-pathname then
the last directory is moved upwards by one.
See <a href="#PATHNAME-UTILS:PARENT">PARENT</a></pre></div> </article> </li></ul> </li></ul> </article> </main> </body> </html>
|