80 lines
7 KiB
HTML
80 lines
7 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: Function TRUENAME</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="f_ensu_1.htm">
|
|
<LINK REL=UP HREF="c_files.htm">
|
|
<LINK REL=NEXT HREF="f_file_a.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="f_ensu_1.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="c_files.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="f_file_a.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
|
|
|
|
<HR>
|
|
|
|
<A NAME="truename"><I>Function</I> <B>TRUENAME</B></A> <P>
|
|
<P><B>Syntax:</B><P>
|
|
<P>
|
|
|
|
<B>truename</B> <I>filespec</I> => <I>truename</I><P>
|
|
<P>
|
|
<P><B>Arguments and Values:</B><P>
|
|
<P>
|
|
<I>filespec</I>---a <A REL=DEFINITION HREF="26_glo_p.htm#pathname_designator"><I>pathname designator</I></A>. <P>
|
|
<I>truename</I>---a <A REL=DEFINITION HREF="26_glo_p.htm#physical_pathname"><I>physical pathname</I></A>. <P>
|
|
<P><B>Description:</B><P>
|
|
<P>
|
|
<A REL=DEFINITION HREF="#truename"><B>truename</B></A> tries to find the <A REL=DEFINITION HREF="26_glo_f.htm#file"><I>file</I></A> indicated by <I>filespec</I> and returns its <A REL=DEFINITION HREF="26_glo_t.htm#truename"><I>truename</I></A>. If the <I>filespec</I> <A REL=DEFINITION HREF="26_glo_d.htm#designator"><I>designator</I></A> is an open <A REL=DEFINITION HREF="26_glo_s.htm#stream"><I>stream</I></A>, its associated <A REL=DEFINITION HREF="26_glo_f.htm#file"><I>file</I></A> is used. If <I>filespec</I> is a <A REL=DEFINITION HREF="26_glo_s.htm#stream"><I>stream</I></A>, <A REL=DEFINITION HREF="#truename"><B>truename</B></A> can be used whether the <A REL=DEFINITION HREF="26_glo_s.htm#stream"><I>stream</I></A> is open or closed. It is permissible for <A REL=DEFINITION HREF="#truename"><B>truename</B></A> to return more specific information after the <A REL=DEFINITION HREF="26_glo_s.htm#stream"><I>stream</I></A> is closed than when the <A REL=DEFINITION HREF="26_glo_s.htm#stream"><I>stream</I></A> was open. If <I>filespec</I> is a <A REL=DEFINITION HREF="26_glo_p.htm#pathname"><I>pathname</I></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><B>Examples:</B><P>
|
|
<P>
|
|
<PRE>
|
|
;; An example involving version numbers. Note that the precise nature of
|
|
;; the truename is implementation-dependent while the file is still open.
|
|
(with-open-file (stream ">vistor>test.text.newest")
|
|
(values (pathname stream)
|
|
(truename stream)))
|
|
=> #P"S:>vistor>test.text.newest", #P"S:>vistor>test.text.1"
|
|
OR=> #P"S:>vistor>test.text.newest", #P"S:>vistor>test.text.newest"
|
|
OR=> #P"S:>vistor>test.text.newest", #P"S:>vistor>_temp_._temp_.1"
|
|
|
|
;; In this case, the file is closed when the truename is tried, so the
|
|
;; truename information is reliable.
|
|
(with-open-file (stream ">vistor>test.text.newest")
|
|
(close stream)
|
|
(values (pathname stream)
|
|
(truename stream)))
|
|
=> #P"S:>vistor>test.text.newest", #P"S:>vistor>test.text.1"
|
|
|
|
;; An example involving TOP-20's implementation-dependent concept
|
|
;; of logical devices -- in this case, "DOC:" is shorthand for
|
|
;; "PS:<DOCUMENTATION>" ...
|
|
(with-open-file (stream "CMUC::DOC:DUMPER.HLP")
|
|
(values (pathname stream)
|
|
(truename stream)))
|
|
=> #P"CMUC::DOC:DUMPER.HLP", #P"CMUC::PS:<DOCUMENTATION>DUMPER.HLP.13"
|
|
</PRE>
|
|
</TT> <P>
|
|
<P><B>Affected By:</B> None.
|
|
<P>
|
|
<P><B>Exceptional Situations:</B><P>
|
|
<P>
|
|
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 if an appropriate <A REL=DEFINITION HREF="26_glo_f.htm#file"><I>file</I></A> cannot be located within the <A REL=DEFINITION HREF="26_glo_f.htm#file_system"><I>file system</I></A> for the given <I>filespec</I>, or if the <A REL=DEFINITION HREF="26_glo_f.htm#file_system"><I>file system</I></A> cannot perform the requested operation. <P>
|
|
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 if <I>pathname</I> is <A REL=DEFINITION HREF="26_glo_w.htm#wild"><I>wild</I></A>. <P>
|
|
<P><B>See Also:</B><P>
|
|
<P>
|
|
<A REL=DEFINITION HREF="t_pn.htm#pathname"><B>pathname</B></A>, <A REL=DEFINITION HREF="t_logica.htm#logical-pathname"><B>logical-pathname</B></A>, <A REL=CHILD HREF="20_a.htm">Section 20.1 (File System Concepts)</A>, <A REL=CHILD HREF="19_ab.htm">Section 19.1.2 (Pathnames as Filenames)</A> <P>
|
|
<P><B>Notes:</B><P>
|
|
<P>
|
|
<A REL=DEFINITION HREF="#truename"><B>truename</B></A> may be used to account for any <A REL=DEFINITION HREF="26_glo_f.htm#filename"><I>filename</I></A> translations performed by the <A REL=DEFINITION HREF="26_glo_f.htm#file_system"><I>file system</I></A>. <P>
|
|
<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/iss267.htm">PATHNAME-WILD:NEW-FUNCTIONS</A><LI> <A REL=CHILD HREF="../Issues/iss157.htm">FILE-OPEN-ERROR:SIGNAL-FILE-ERROR</A><LI> <A REL=CHILD HREF="../Issues/iss053.htm">CLOSED-STREAM-OPERATIONS:ALLOW-INQUIRY</A><LI> <A REL=CHILD HREF="../Issues/iss259.htm">PATHNAME-LOGICAL:ADD</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>
|