Debian Codegraph @

info/gcl/pathname.html

raw
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <title>pathname (ANSI and GNU Common Lisp Document)</title>
7
8 <meta name="description" content="pathname (ANSI and GNU Common Lisp Document)">
9 <meta name="keywords" content="pathname (ANSI and GNU Common Lisp Document)">
10 <meta name="resource-type" content="document">
11 <meta name="distribution" content="global">
12 <meta name="Generator" content="makeinfo">
13 <link href="index.html" rel="start" title="Top">
14 <link href="Filenames-Dictionary.html" rel="up" title="Filenames Dictionary">
15 <link href="make_002dpathname.html" rel="next" title="make-pathname">
16 <link href="logical_002dpathname-_0028System-Class_0029.html" rel="prev" title="logical-pathname (System Class)">
17 <style type="text/css">
18 <!--
19 a.summary-letter {text-decoration: none}
20 blockquote.indentedblock {margin-right: 0em}
21 div.display {margin-left: 3.2em}
22 div.example {margin-left: 3.2em}
23 div.lisp {margin-left: 3.2em}
24 kbd {font-style: oblique}
25 pre.display {font-family: inherit}
26 pre.format {font-family: inherit}
27 pre.menu-comment {font-family: serif}
28 pre.menu-preformatted {font-family: serif}
29 span.nolinebreak {white-space: nowrap}
30 span.roman {font-family: initial; font-weight: normal}
31 span.sansserif {font-family: sans-serif; font-weight: normal}
32 ul.no-bullet {list-style: none}
33 -->
34 </style>
35
36
37 </head>
38
39 <body lang="en">
40 <span id="pathname"></span><div class="header">
41 <p>
42 Next: <a href="make_002dpathname.html" accesskey="n" rel="next">make-pathname</a>, Previous: <a href="logical_002dpathname-_0028System-Class_0029.html" accesskey="p" rel="prev">logical-pathname (System Class)</a>, Up: <a href="Filenames-Dictionary.html" accesskey="u" rel="up">Filenames Dictionary</a> &nbsp; </p>
43 </div>
44 <hr>
45 <span id="pathname-_005bFunction_005d"></span><h4 class="subsection">19.4.3 pathname [Function]</h4>
46
47 <p><code>pathname</code> <i>pathspec</i> &rArr; <i>pathname</i>
48 </p>
49 <span id="Arguments-and-Values_003a_003a-389"></span><h4 class="subsubheading">Arguments and Values::</h4>
50
51 <p><i>pathspec</i>&mdash;a <i>pathname designator</i>.
52 </p>
53 <p><i>pathname</i>&mdash;a <i>pathname</i>.
54 </p>
55 <span id="Description_003a_003a-507"></span><h4 class="subsubheading">Description::</h4>
56
57 <p>Returns the <i>pathname</i> denoted by <i>pathspec</i>.
58 </p>
59 <p>If the <i>pathspec</i> <i>designator</i> is a <i>stream</i>,
60 the <i>stream</i> can be either open or closed;
61 in both cases, the <b>pathname</b> returned
62 corresponds to the <i>filename</i> used to open the <i>file</i>.
63 <b>pathname</b> returns the same <i>pathname</i> for a <i>file stream</i>
64 after it is closed as it did when it was open.
65 </p>
66 <p>If the <i>pathspec</i> <i>designator</i> is
67 a <i>file stream</i> created by opening a <i>logical pathname</i>,
68 a <i>logical pathname</i> is returned.
69 </p>
70 <span id="Examples_003a_003a-369"></span><h4 class="subsubheading">Examples::</h4>
71
72 <div class="example">
73 <pre class="example"> ;; There is a great degree of variability permitted here. The next
74 ;; several examples are intended to illustrate just a few of the many
75 ;; possibilities. Whether the name is canonicalized to a particular
76 ;; case (either upper or lower) depends on both the file system and the
77 ;; implementation since two different implementations using the same
78 ;; file system might differ on many issues. How information is stored
79 ;; internally (and possibly presented in #S notation) might vary,
80 ;; possibly requiring `accessors' such as PATHNAME-NAME to perform case
81 ;; conversion upon access. The format of a namestring is dependent both
82 ;; on the file system and the implementation since, for example, one
83 ;; implementation might include the host name in a namestring, and
84 ;; another might not. #S notation would generally only be used in a
85 ;; situation where no appropriate namestring could be constructed for use
86 ;; with #P.
87 (setq p1 (pathname &quot;test&quot;))
88 &rArr; #P&quot;CHOCOLATE:TEST&quot; ; with case canonicalization (e.g., VMS)
89 <i>OR</i>&rArr; #P&quot;VANILLA:test&quot; ; without case canonicalization (e.g., Unix)
90 <i>OR</i>&rArr; #P&quot;test&quot;
91 <i>OR</i>&rArr; #S(PATHNAME :HOST &quot;STRAWBERRY&quot; :NAME &quot;TEST&quot;)
92 <i>OR</i>&rArr; #S(PATHNAME :HOST &quot;BELGIAN-CHOCOLATE&quot; :NAME &quot;test&quot;)
93 (setq p2 (pathname &quot;test&quot;))
94 &rArr; #P&quot;CHOCOLATE:TEST&quot;
95 <i>OR</i>&rArr; #P&quot;VANILLA:test&quot;
96 <i>OR</i>&rArr; #P&quot;test&quot;
97 <i>OR</i>&rArr; #S(PATHNAME :HOST &quot;STRAWBERRY&quot; :NAME &quot;TEST&quot;)
98 <i>OR</i>&rArr; #S(PATHNAME :HOST &quot;BELGIAN-CHOCOLATE&quot; :NAME &quot;test&quot;)
99 (pathnamep p1) &rArr; <i>true</i>
100 (eq p1 (pathname p1)) &rArr; <i>true</i>
101 (eq p1 p2)
102 &rArr; <i>true</i>
103 <i>OR</i>&rArr; <i>false</i>
104 (with-open-file (stream &quot;test&quot; :direction :output)
105 (pathname stream))
106 &rArr; #P&quot;ORANGE-CHOCOLATE:&gt;Gus&gt;test.lisp.newest&quot;
107 </pre></div>
108
109 <span id="See-Also_003a_003a-412"></span><h4 class="subsubheading">See Also::</h4>
110
111 <p><b>pathname</b>,
112 <b>logical-pathname</b>,
113 <a href="File-System-Concepts.html">File System Concepts</a>,
114 </p>
115 <p><a href="Pathnames-as-Filenames.html">Pathnames as Filenames</a>
116 </p>
117 <hr>
118 <div class="header">
119 <p>
120 Next: <a href="make_002dpathname.html" accesskey="n" rel="next">make-pathname</a>, Previous: <a href="logical_002dpathname-_0028System-Class_0029.html" accesskey="p" rel="prev">logical-pathname (System Class)</a>, Up: <a href="Filenames-Dictionary.html" accesskey="u" rel="up">Filenames Dictionary</a> &nbsp; </p>
121 </div>
122
123
124
125 </body>
126 </html>