Skip to main content

logical-pathname

logical-pathname System Class

Class Precedence List:

logical-pathname, pathname, t

Description:

A pathname that uses a namestring syntax that is implementation-independent, and that has component values that are implementation-independent. Logical pathnames do not refer directly to filenames

See Also:

Section 20.1 (File System Concepts), Section 2.4.8.14 (Sharpsign P), Section 22.1.3.11 (Printing Pathnames)

Expanded Reference: logical-pathname (System Class)

Logical pathnames are a subtype of pathname

A logical pathname provides a portable, implementation-independent way to specify file locations. It is a subtype of pathname.

(subtypep 'logical-pathname 'pathname)
=> T
=> T

Creating and recognizing logical pathnames

Logical pathnames are created by establishing translations and then using logical pathname namestrings.

(setf (logical-pathname-translations "MYLIB")
'(("**;*.*.*" "/usr/lib/mylib/**/*.*")))

(typep (logical-pathname "MYLIB:SRC;UTILS.LISP") 'logical-pathname)
=> T

(typep #P"/tmp/test.lisp" 'logical-pathname)
=> NIL

Logical pathnames satisfy pathnamep

Since logical-pathname is a subclass of pathname, logical pathnames also satisfy pathnamep.

(setf (logical-pathname-translations "TESTH")
'(("**;*.*.*" "/tmp/**/*.*")))

(let ((lp (logical-pathname "TESTH:DATA;FILE.TXT")))
(values (pathnamep lp)
(typep lp 'logical-pathname)))
=> T
=> T