emacs.d/clones/lisp/HyperSpec-7-0/HyperSpec/Body/19_ab.htm
2023-01-18 20:30:47 +01:00

46 lines
9.9 KiB
HTML

<!-- Common Lisp HyperSpec (TM), version 7.0 generated by Kent M. Pitman on Mon, 11-Apr-2005 2:31am EDT -->
<HTML>
<HEAD>
<TITLE>CLHS: Section 19.1.2</TITLE>
<LINK HREF="../Data/clhs.css" REL="stylesheet" TYPE="text/css" />
<META HTTP-EQUIV="Author" CONTENT="Kent M. Pitman">
<META HTTP-EQUIV="Organization" CONTENT="LispWorks Ltd.">
<LINK REL=TOP HREF="../Front/index.htm">
<LINK REL=COPYRIGHT HREF="../Front/Help.htm#Legal">
<LINK REL=DISCLAIMER HREF="../Front/Help.htm#Disclaimer">
<LINK REL=PREV HREF="19_aa.htm">
<LINK REL=UP HREF="19_a.htm">
<LINK REL=NEXT HREF="19_ac.htm">
</HEAD>
<BODY>
<H1><A REV=MADE HREF="http://www.lispworks.com/"><IMG WIDTH=80 HEIGHT=65 ALT="[LISPWORKS]" SRC="../Graphics/LWSmall.gif" ALIGN=Bottom></A><A REL=TOP HREF="../Front/index.htm"><IMG WIDTH=237 HEIGHT=65 ALT="[Common Lisp HyperSpec (TM)]" SRC="../Graphics/CLHS_Sm.gif" ALIGN=Bottom></A> <A REL=PREV HREF="19_aa.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="19_a.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="19_ac.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<H2>
19.1.2 Pathnames as Filenames</H2> <P>
<A REL=DEFINITION HREF="26_glo_p.htm#pathname"><I>Pathnames</I></A> are structured <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>objects</I></A> that can represent, in an <A REL=DEFINITION HREF="26_glo_i.htm#implementation-independent"><I>implementation-independent</I></A> way, the <A REL=DEFINITION HREF="26_glo_f.htm#filename"><I>filenames</I></A> that are used natively by an underlying <A REL=DEFINITION HREF="26_glo_f.htm#file_system"><I>file system</I></A>. <P>
In addition, <A REL=DEFINITION HREF="26_glo_p.htm#pathname"><I>pathnames</I></A> can also represent certain partially composed <A REL=DEFINITION HREF="26_glo_f.htm#filename"><I>filenames</I></A> for which an underlying <A REL=DEFINITION HREF="26_glo_f.htm#file_system"><I>file system</I></A> might not have a specific <A REL=DEFINITION HREF="26_glo_n.htm#namestring"><I>namestring</I></A> representation. <P>
A <A REL=DEFINITION HREF="26_glo_p.htm#pathname"><I>pathname</I></A> need not correspond to any file that actually exists, and more than one <A REL=DEFINITION HREF="26_glo_p.htm#pathname"><I>pathname</I></A> can refer to the same file. For example, the <A REL=DEFINITION HREF="26_glo_p.htm#pathname"><I>pathname</I></A> with a version of <TT>:newest</TT> might refer to the same file as a <A REL=DEFINITION HREF="26_glo_p.htm#pathname"><I>pathname</I></A> with the same components except a certain number as the version. Indeed, a <A REL=DEFINITION HREF="26_glo_p.htm#pathname"><I>pathname</I></A> with version <TT>:newest</TT> might refer to different files as time passes, because the meaning of such a <A REL=DEFINITION HREF="26_glo_p.htm#pathname"><I>pathname</I></A> depends on the state of the file system. <P>
Some <A REL=DEFINITION HREF="26_glo_f.htm#file_system"><I>file systems</I></A> naturally use a structural model for their <A REL=DEFINITION HREF="26_glo_f.htm#filename"><I>filenames</I></A>, while others do not. Within the Common Lisp <A REL=DEFINITION HREF="26_glo_p.htm#pathname"><I>pathname</I></A> model, all <A REL=DEFINITION HREF="26_glo_f.htm#filename"><I>filenames</I></A> are seen as having a particular structure, even if that structure is not reflected in the underlying <A REL=DEFINITION HREF="26_glo_f.htm#file_system"><I>file system</I></A>. The nature of the mapping between structure imposed by <A REL=DEFINITION HREF="26_glo_p.htm#pathname"><I>pathnames</I></A> and the structure, if any, that is used by the underlying <A REL=DEFINITION HREF="26_glo_f.htm#file_system"><I>file system</I></A> is <A REL=DEFINITION HREF="26_glo_i.htm#implementation-defined"><I>implementation-defined</I></A>. <P>
Every <A REL=DEFINITION HREF="26_glo_p.htm#pathname"><I>pathname</I></A> has six components: a host, a device, a directory, a name, a type, and a version. By naming <A REL=DEFINITION HREF="26_glo_f.htm#file"><I>files</I></A> with <A REL=DEFINITION HREF="26_glo_p.htm#pathname"><I>pathnames</I></A>, Common Lisp programs can work in essentially the same way even in <A REL=DEFINITION HREF="26_glo_f.htm#file_system"><I>file systems</I></A> that seem superficially quite different. For a detailed description of these components, see <A REL=CHILD HREF="19_ba.htm">Section 19.2.1 (Pathname Components)</A>. <P>
The mapping of the <A REL=DEFINITION HREF="26_glo_p.htm#pathname"><I>pathname</I></A> components into the concepts peculiar to each <A REL=DEFINITION HREF="26_glo_f.htm#file_system"><I>file system</I></A> is <A REL=DEFINITION HREF="26_glo_i.htm#implementation-defined"><I>implementation-defined</I></A>. There exist conceivable <A REL=DEFINITION HREF="26_glo_p.htm#pathname"><I>pathnames</I></A> for which there is no mapping to a syntactically valid <A REL=DEFINITION HREF="26_glo_f.htm#filename"><I>filename</I></A> in a particular <A REL=DEFINITION HREF="26_glo_i.htm#implementation"><I>implementation</I></A>. An <A REL=DEFINITION HREF="26_glo_i.htm#implementation"><I>implementation</I></A> may use various strategies in an attempt to find a mapping; for example, an <A REL=DEFINITION HREF="26_glo_i.htm#implementation"><I>implementation</I></A> may quietly truncate <A REL=DEFINITION HREF="26_glo_f.htm#filename"><I>filenames</I></A> that exceed length limitations imposed by the underlying <A REL=DEFINITION HREF="26_glo_f.htm#file_system"><I>file system</I></A>, or ignore certain <A REL=DEFINITION HREF="26_glo_p.htm#pathname"><I>pathname</I></A> components for which the <A REL=DEFINITION HREF="26_glo_f.htm#file_system"><I>file system</I></A> provides no support. If such a mapping cannot be found, an error of <A REL=DEFINITION HREF="26_glo_t.htm#type"><I>type</I></A> <A REL=DEFINITION HREF="e_file_e.htm#file-error"><B>file-error</B></A> is signaled. <P>
The time at which this mapping and associated error signaling occurs is <A REL=DEFINITION HREF="26_glo_i.htm#implementation-dependent"><I>implementation-dependent</I></A>. Specifically, it may occur at the time the <A REL=DEFINITION HREF="26_glo_p.htm#pathname"><I>pathname</I></A> is constructed, when coercing a <A REL=DEFINITION HREF="26_glo_p.htm#pathname"><I>pathname</I></A> to a <A REL=DEFINITION HREF="26_glo_n.htm#namestring"><I>namestring</I></A>, or when an attempt is made to <A REL=DEFINITION HREF="26_glo_o.htm#open"><I>open</I></A> or otherwise access the <A REL=DEFINITION HREF="26_glo_f.htm#file"><I>file</I></A> designated by the <A REL=DEFINITION HREF="26_glo_p.htm#pathname"><I>pathname</I></A>. <P>
The next figure lists some <A REL=DEFINITION HREF="26_glo_d.htm#defined_name"><I>defined names</I></A> that are applicable to <A REL=DEFINITION HREF="26_glo_p.htm#pathname"><I>pathnames</I></A>. <P>
<PRE>
<A REL=DEFINITION HREF="v_defaul.htm#STdefault-pathname-defaultsST">*default-pathname-defaults*</A> <A REL=DEFINITION HREF="f_namest.htm#namestring">namestring</A> <A REL=DEFINITION HREF="f_pn_hos.htm#pathname-name">pathname-name</A>
<A REL=DEFINITION HREF="f_namest.htm#directory-namestring">directory-namestring</A> <A REL=DEFINITION HREF="f_open.htm#open">open</A> <A REL=DEFINITION HREF="f_pn_hos.htm#pathname-type">pathname-type</A>
<A REL=DEFINITION HREF="f_namest.htm#enough-namestring">enough-namestring</A> <A REL=DEFINITION HREF="f_pars_1.htm#parse-namestring">parse-namestring</A> <A REL=DEFINITION HREF="f_pn_hos.htm#pathname-version">pathname-version</A>
<A REL=DEFINITION HREF="f_namest.htm#file-namestring">file-namestring</A> <A REL=DEFINITION HREF="a_pn.htm#pathname">pathname</A> <A REL=DEFINITION HREF="f_pnp.htm#pathnamep">pathnamep</A>
<A REL=DEFINITION HREF="f_file_s.htm#file-string-length">file-string-length</A> <A REL=DEFINITION HREF="f_pn_hos.htm#pathname-device">pathname-device</A> <A REL=DEFINITION HREF="f_tr_pn.htm#translate-pathname">translate-pathname</A>
<A REL=DEFINITION HREF="f_namest.htm#host-namestring">host-namestring</A> <A REL=DEFINITION HREF="f_pn_hos.htm#pathname-directory">pathname-directory</A> <A REL=DEFINITION HREF="f_tn.htm#truename">truename</A>
<A REL=DEFINITION HREF="f_mk_pn.htm#make-pathname">make-pathname</A> <A REL=DEFINITION HREF="f_pn_hos.htm#pathname-host">pathname-host</A> <A REL=DEFINITION HREF="f_user_h.htm#user-homedir-pathname">user-homedir-pathname</A>
<A REL=DEFINITION HREF="f_merge_.htm#merge-pathnames">merge-pathnames</A> <A REL=DEFINITION HREF="f_pn_mat.htm#pathname-match-p">pathname-match-p</A> <A REL=DEFINITION HREF="f_wild_p.htm#wild-pathname-p">wild-pathname-p</A>
</PRE>
<P><B>Figure 19-1. Pathname Operations</B> <P><HR>The following <A REL=META HREF="../Front/X3J13Iss.htm">X3J13 cleanup issues</A>, <I>not part of the specification</I>, apply to this section:<P><UL><LI> <A REL=CHILD HREF="../Issues/iss265.htm">PATHNAME-SYNTAX-ERROR-TIME:EXPLICITLY-VAGUE</A><LI> <A REL=CHILD HREF="../Issues/iss157.htm">FILE-OPEN-ERROR:SIGNAL-FILE-ERROR</A><P></UL><HR>
<A REL=NAVIGATOR HREF="../Front/StartPts.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Starting Points]" SRC="../Graphics/StartPts.gif" ALIGN=Bottom></A><A REL=TOC HREF="../Front/Contents.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Contents]" SRC="../Graphics/Contents.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Master.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Index]" SRC="../Graphics/Index.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Symbol.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Symbols]" SRC="../Graphics/Symbols.gif" ALIGN=Bottom></A><A REL=GLOSSARY HREF="../Body/26_a.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Glossary]" SRC="../Graphics/Glossary.gif" ALIGN=Bottom></A><A HREF="../Front/X3J13Iss.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Issues]" SRC="../Graphics/Issues.gif" ALIGN=Bottom></A><BR>
<A REL=COPYRIGHT HREF="../Front/Help.htm#Legal"><I>Copyright 1996-2005, LispWorks Ltd. All rights reserved.</I></A><P>
</BODY>
</HTML>