1
0
Fork 0
cl-sites/novaspec.org/cl/f_pathname-host.html
2025-02-05 18:52:26 +01:00

558 lines
No EOL
12 KiB
HTML

<!DOCTYPE HTML>
<HTML LANG="en-us"
><HEAD
><TITLE
>pathname-host, pathname-device, pathname-directory, pathname-name, pathname-type, pathname-version | Common Lisp Nova Spec</TITLE
><META CHARSET="US-ASCII"
><LINK REL="canonical" HREF="f_pathname-host.html"
><LINK REL="next" HREF="f_load-logical-pathname-translations.html" TYPE="text/html" TITLE="load-logical-pathname-translations"
><LINK REL="prev" HREF="f_pathnamep.html" TYPE="text/html" TITLE="pathnamep"
><LINK REL="up" HREF="19_4_Filenames_Dictionary.html" TYPE="text/html" TITLE="19.4 Filenames Dictionary"
><LINK REL="start" HREF="index.html" TYPE="text/html" TITLE="Common Lisp Nova Spec"
><META NAME="VIEWPORT" CONTENT="width=device-width, initial-scale=1.0"
><LINK REL="STYLESHEET" HREF="dpans.css%3F3909942064.css"
><SCRIPT SRC="dpans.js%3F3909942064"
></SCRIPT
><SCRIPT SRC="apropos.js%3F3909942064"
></SCRIPT
></HEAD
><BODY
><DIV
><DIV CLASS="topnav"
><DIV CLASS="breadcrumb"
><SPAN CLASS="breadcrumb-item"
><A HREF="index.html"
>Common Lisp Nova Spec</A
></SPAN
> <SPAN CLASS="breadcrumb-item"
>&#8594; <A HREF="19_Filenames.html"
>19. Filenames</A
></SPAN
> <SPAN CLASS="breadcrumb-item"
>&#8594; <A HREF="19_4_Filenames_Dictionary.html"
>19.4 Filenames Dictionary</A
></SPAN
> <SPAN CLASS="breadcrumb-item"
>&#8594; <A HREF="f_pathname-host.html"
>pathname-host, pathname-device, pathname-directory, pathname-name, pathname-type, pathname-version</A
></SPAN
></DIV
><DIV CLASS="apropos"
><DIV CLASS="apropos-io"
><A HREF="f_pathnamep.html" CLASS="prev"
>&#8592;</A
><SPAN ID="apropos-label"
>Apropos </SPAN
><INPUT ID="apropos" AUTOFOCUS="AUTOFOCUS" PLACEHOLDER="Type here to search" ONINPUT="aproposInput(this);" ONKEYUP="aproposKeyup(event);" ONCHANGE="aproposChange(this);" ONFOCUS="aproposFocus(this);" ONFOCUSOUT="aproposFocusout(this);"
><A HREF="f_load-logical-pathname-translations.html" CLASS="next"
>&#8594;</A
></DIV
><DIV ID="apropos-res"
></DIV
></DIV
></DIV
><DIV CLASS="matter"
><DIV CLASS="com"
><DIV CLASS="begincom"
><HR
><TABLE WIDTH="100%" CELLSPACING="0" CELLPADDING="0"
><TR
><TD ALIGN="LEFT" VALIGN="BASELINE" WIDTH="100%" CLASS="name"
><SPAN CLASS="idx" DATA-KIND="idxref" DATA-TERM="pathname-host, pathname-device, pathname-directory, pathname-name, pathname-type, pathname-version"
></SPAN
><B
>pathname-host, pathname-device, pathname-directory, pathname-name, pathname-type, pathname-version</B
></TD
><TD ALIGN="RIGHT" VALIGN="BASELINE" WIDTH="0" NOWRAP="NOWRAP" CLASS="ftype"
><I
>Function</I
></TD
></TR
></TABLE
><HR
></DIV
><UL CLASS="subtoc"
></UL
><DL
><DT
><B
>Syntax</B
></DT
><DD
><P CLASS="j"
><B
>pathname-host</B
> <SPAN CLASS="cmssi"
>pathname</SPAN
> <SPAN CLASS="cmtt"
>&amp;key</SPAN
> <SPAN CLASS="cmssi"
>case</SPAN
> <SPAN CLASS="arrow"
>&#8594;</SPAN
> <SPAN CLASS="cmssi"
>host</SPAN
></P
><P CLASS="j"
><B
>pathname-device</B
> <SPAN CLASS="cmssi"
>pathname</SPAN
> <SPAN CLASS="cmtt"
>&amp;key</SPAN
> <SPAN CLASS="cmssi"
>case</SPAN
> <SPAN CLASS="arrow"
>&#8594;</SPAN
> <SPAN CLASS="cmssi"
>device</SPAN
></P
><P CLASS="j"
><B
>pathname-directory</B
> <SPAN CLASS="cmssi"
>pathname</SPAN
> <SPAN CLASS="cmtt"
>&amp;key</SPAN
> <SPAN CLASS="cmssi"
>case</SPAN
> <SPAN CLASS="arrow"
>&#8594;</SPAN
> <SPAN CLASS="cmssi"
>directory</SPAN
></P
><P CLASS="j"
><B
>pathname-name</B
> <SPAN CLASS="cmssi"
>pathname</SPAN
> <SPAN CLASS="cmtt"
>&amp;key</SPAN
> <SPAN CLASS="cmssi"
>case</SPAN
> <SPAN CLASS="arrow"
>&#8594;</SPAN
> <SPAN CLASS="cmssi"
>name</SPAN
></P
><P CLASS="j"
><B
>pathname-type</B
> <SPAN CLASS="cmssi"
>pathname</SPAN
> <SPAN CLASS="cmtt"
>&amp;key</SPAN
> <SPAN CLASS="cmssi"
>case</SPAN
> <SPAN CLASS="arrow"
>&#8594;</SPAN
> <SPAN CLASS="cmssi"
>type</SPAN
></P
><P CLASS="j"
><B
>pathname-version</B
> <SPAN CLASS="cmssi"
>pathname</SPAN
> <SPAN CLASS="arrow"
>&#8594;</SPAN
> <SPAN CLASS="cmssi"
>version</SPAN
></P
></DD
><DT
><B
>Arguments and Values</B
></DT
><DD
><P CLASS="j"
><VAR CLASS="param"
>pathname</VAR
> &#8212; a <A HREF="26_1_Glossary.html#pathname_designator"
><EM CLASS="term"
>pathname designator</EM
></A
>. </P
><P CLASS="j"
><VAR CLASS="param"
>case</VAR
> &#8212; one of <SPAN CLASS="kwd"
><SPAN CLASS="cmtt"
>:local</SPAN
></SPAN
> or <SPAN CLASS="kwd"
><SPAN CLASS="cmtt"
>:common</SPAN
></SPAN
>. The default is <SPAN CLASS="kwd"
><SPAN CLASS="cmtt"
>:local</SPAN
></SPAN
>. </P
><P CLASS="j"
><VAR CLASS="param"
>host</VAR
> &#8212; a <A HREF="26_1_Glossary.html#valid_pathname_host"
><EM CLASS="term"
>valid pathname host</EM
></A
>. </P
><P CLASS="j"
><VAR CLASS="param"
>device</VAR
> &#8212; a <A HREF="26_1_Glossary.html#valid_pathname_device"
><EM CLASS="term"
>valid pathname device</EM
></A
>. </P
><P CLASS="j"
><VAR CLASS="param"
>directory</VAR
> &#8212; a <A HREF="26_1_Glossary.html#valid_pathname_directory"
><EM CLASS="term"
>valid pathname directory</EM
></A
>. </P
><P CLASS="j"
><VAR CLASS="param"
>name</VAR
> &#8212; a <A HREF="26_1_Glossary.html#valid_pathname_name"
><EM CLASS="term"
>valid pathname name</EM
></A
>. </P
><P CLASS="j"
><VAR CLASS="param"
>type</VAR
> &#8212; a <A HREF="26_1_Glossary.html#valid_pathname_type"
><EM CLASS="term"
>valid pathname type</EM
></A
>. </P
><P CLASS="j"
><VAR CLASS="param"
>version</VAR
> &#8212; a <A HREF="26_1_Glossary.html#valid_pathname_version"
><EM CLASS="term"
>valid pathname version</EM
></A
>.</P
></DD
><DT
><B
>Description</B
></DT
><DD
><P CLASS="j"
>These functions return the components of <VAR CLASS="param"
>pathname</VAR
>. </P
><P CLASS="j"
>If the <VAR CLASS="param"
>pathname</VAR
> <A HREF="26_1_Glossary.html#designator"
><EM CLASS="term"
>designator</EM
></A
> is a <A HREF="26_1_Glossary.html#pathname"
><EM CLASS="term"
>pathname</EM
></A
>, it represents the name used to open the file. This may be, but is not required to be, the actual name of the file. </P
><P CLASS="j"
>If <VAR CLASS="param"
>case</VAR
> is supplied, it is treated as described in <A HREF="19_2_Pathnames.html#sec_19_2_2_1_2" CLASS="secref"
><SPAN CLASS="cmr"
>Section</SPAN
> <SPAN CLASS="cmr"
>19.2.2.1.2</SPAN
> <SPAN CLASS="cmr"
>(Case</SPAN
> <SPAN CLASS="cmr"
>in</SPAN
> <SPAN CLASS="cmr"
>Pathname</SPAN
> <SPAN CLASS="cmr"
>Components)</SPAN
></A
>.</P
></DD
><DT
><B
>Examples</B
></DT
><DD
><PRE CLASS="screen"
> (setq q (make-pathname :host "KATHY"
:directory "CHAPMAN"
:name "LOGIN" :type "COM"))
<SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> #P"KATHY::[CHAPMAN]LOGIN.COM"
(pathname-host q) <SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> "KATHY"
(pathname-name q) <SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> "LOGIN"
(pathname-type q) <SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> "COM"
;; Because namestrings are used, the results shown in the remaining
;; examples are not necessarily the only possible results. Mappings
;; from namestring representation to pathname representation are
;; dependent both on the file system involved and on the implementation
;; (since there may be several implementations which can manipulate the
;; the same file system, and those implementations are not constrained
;; to agree on all details). Consult the documentation for each
;; implementation for specific information on how namestrings are treated
;; that implementation.
;; VMS
(pathname-directory (parse-namestring "[FOO.*.BAR]BAZ.LSP"))
<SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> (:ABSOLUTE "FOO" "BAR")
(pathname-directory (parse-namestring "[FOO.*.BAR]BAZ.LSP") :case :common)
<SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> (:ABSOLUTE "FOO" "BAR")
;; Unix
(pathname-directory "foo.l") <SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> NIL
(pathname-device "foo.l") <SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> :UNSPECIFIC
(pathname-name "foo.l") <SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> "foo"
(pathname-name "foo.l" :case :local) <SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> "foo"
(pathname-name "foo.l" :case :common) <SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> "FOO"
(pathname-type "foo.l") <SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> "l"
(pathname-type "foo.l" :case :local) <SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> "l"
(pathname-type "foo.l" :case :common) <SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> "L"
(pathname-type "foo") <SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> :UNSPECIFIC
(pathname-type "foo" :case :common) <SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> :UNSPECIFIC
(pathname-type "foo.") <SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> ""
(pathname-type "foo." :case :common) <SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> ""
(pathname-directory (parse-namestring "/foo/bar/baz.lisp") :case :local)
<SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> (:ABSOLUTE "foo" "bar")
(pathname-directory (parse-namestring "/foo/bar/baz.lisp") :case :local)
<SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> (:ABSOLUTE "FOO" "BAR")
(pathname-directory (parse-namestring "../baz.lisp"))
<SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> (:RELATIVE :UP)
(PATHNAME-DIRECTORY (PARSE-NAMESTRING "/foo/BAR/../Mum/baz"))
<SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> (:ABSOLUTE "foo" "BAR" :UP "Mum")
(PATHNAME-DIRECTORY (PARSE-NAMESTRING "/foo/BAR/../Mum/baz") :case :common)
<SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> (:ABSOLUTE "FOO" "bar" :UP "Mum")
(PATHNAME-DIRECTORY (PARSE-NAMESTRING "/foo/*/bar/baz.l"))
<SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> (:ABSOLUTE "foo" :WILD "bar")
(PATHNAME-DIRECTORY (PARSE-NAMESTRING "/foo/*/bar/baz.l") :case :common)
<SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> (:ABSOLUTE "FOO" :WILD "BAR")
;; Symbolics LMFS
(pathname-directory (parse-namestring "&gt;foo&gt;**&gt;bar&gt;baz.lisp"))
<SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> (:ABSOLUTE "foo" :WILD-INFERIORS "bar")
(pathname-directory (parse-namestring "&gt;foo&gt;*&gt;bar&gt;baz.lisp"))
<SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> (:ABSOLUTE "foo" :WILD "bar")
(pathname-directory (parse-namestring "&gt;foo&gt;*&gt;bar&gt;baz.lisp") :case :common)
<SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> (:ABSOLUTE "FOO" :WILD "BAR")
(pathname-device (parse-namestring "&gt;foo&gt;baz.lisp")) <SPAN CLASS="cmsy"
><SPAN CLASS="arrow"
>&#8594;</SPAN
></SPAN
> :UNSPECIFIC</PRE
></DD
><DT
><B
>Affected By</B
></DT
><DD
><P CLASS="j"
>The <A HREF="26_1_Glossary.html#implementation"
><EM CLASS="term"
>implementation</EM
></A
> and the host <A HREF="26_1_Glossary.html#file_system"
><EM CLASS="term"
>file system</EM
></A
>.</P
></DD
><DT
><B
>Exceptional Situations</B
></DT
><DD
><P CLASS="j"
>Should signal an error of <A HREF="26_1_Glossary.html#type"
><EM CLASS="term"
>type</EM
></A
> <A HREF="t_type-error.html" CLASS="typeref"
><B
>type-error</B
></A
> if its first argument is not a <A HREF="26_1_Glossary.html#pathname"
><EM CLASS="term"
>pathname</EM
></A
>.</P
></DD
><DT
><B
>See Also</B
></DT
><DD
><P CLASS="j"
><A HREF="t_pathname.html" CLASS="typeref"
><B
>pathname</B
></A
>, <A HREF="t_logical-pathname.html" CLASS="typeref"
><B
>logical-pathname</B
></A
>, <A HREF="20_1_File_System_Concepts.html#sec_20_1" CLASS="secref"
><SPAN CLASS="cmr"
>Section</SPAN
> <SPAN CLASS="cmr"
>20.1</SPAN
> <SPAN CLASS="cmr"
>(File</SPAN
> <SPAN CLASS="cmr"
>System</SPAN
> <SPAN CLASS="cmr"
>Concepts)</SPAN
></A
>, <A HREF="19_1_Overview_of_Filenames.html#sec_19_1_2" CLASS="secref"
><SPAN CLASS="cmr"
>Section</SPAN
> <SPAN CLASS="cmr"
>19.1.2</SPAN
> <SPAN CLASS="cmr"
>(Pathnames</SPAN
> <SPAN CLASS="cmr"
>as</SPAN
> <SPAN CLASS="cmr"
>Filenames)</SPAN
></A
></P
></DD
></DL
></DIV
></DIV
><DIV CLASS="footer"
><DIV CLASS="btmnav"
><A HREF="f_pathnamep.html" CLASS="prev"
>&#8592;</A
><A HREF="f_load-logical-pathname-translations.html" CLASS="next"
>&#8594;</A
></DIV
><DIV CLASS="trail"
>Conversion to HTML copyright 2023 by Gilbert Baumann</DIV
></DIV
></DIV
><SCRIPT
>domReady();</SCRIPT
></BODY
></HTML
>