[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: truename, merge-pathnames, etc.
>From: IN%"Sandra J Loosemore <sandra%orion@CS.UTAH.EDU>" 7-AUG-1987 04:58
>Subj: truename, merge-pathnames, etc.
>
>I'm having a problem with incorrect expansion of pathnames under VMS, when
>logical names are used. The problem happens when I, or the Lisp runtime, does
>something like
>
> (merge-pathnames "LIBRARY:" *default-pathname-defaults*)
>
>My logical name "LIBRARY:" is likely to translate to a string that supplies
>both a device and directory. However, the Lisp doesn't do the translation and
>is instead pulling the directory from *default-pathname-defaults*, with the
>end result that it builds up a pathname pointing to the wrong place. I can't
>use TRUENAME to force translation of the logical name first, because it
>complains about not being able to find a file that matches the incomplete
>specification. And, I can't build up a complete file specification to give
>to TRUENAME because of the other problem. Perhaps we need another function
>like TRUENAME that just does the name translation without checking to see
>that the file exists?
>
>-Sandra
>-------
>
Hm... What version of VAX-LISP are you using? I just did some tests and it
actually works ok for me:
Lisp> (translate-logical-name "LLVS")
("LLVS$DISK:[LLVS]")
Lisp> (merge-pathnames "LLVS:" *default-pathname-defaults*)
#S(pathname :host "VAX9" :device "VIS3$DISK" :directory "LLVS" :name nil
:type nil :version :newest)
Lisp> *default-pathname-defaults*
#S(pathname :host "VAX9" :device "VIS$DISK"
:directory "HELLER.VISION.NEW_SYSTEM" :name nil :type nil
:version nil)
For completeness I also tried:
Lisp> (merge-pathnames (pathname "LLVS:") *default-pathname-defaults*)
#S(pathname :host "VAX9" :device "VIS3$DISK" :directory "LLVS" :name nil
:type nil :version :newest)
I think the last version is probably safest, since it forces the logical
name to be processed into a proper pathname. There is still a problem with
search lists (logical names with a list of values). For that you probably
should not use merge-pathnames at all - instead use concatenate to create an
un-parsed filename string and use probe-file to fetch the actual path.
(Probe-file correctly handle search lists, since it calls RMS to search
for the file (probably with a SYS$SEARCH call).)
BTW: we are running VMS 4.5 and VAX-LISP U2.2 (yes we are a field test
site).
Robert Heller
ARPANet: Heller@CS.UMass.EDU
BITNET: Heller@UMass.BITNET
BIX: Heller
GEnie: RHeller
FidoNet: 321/148 (Locks Hill BBS, Wendell, MA)
CompuServe 71450,3432
Local PV VAXen: COINS::HELLER
UCC Cyber/DG: Heller@CS