next up previous contents index
Next: Wildcard Pathnames Up: Pathnames Previous: Pathnames   Contents   Index


Unix Pathnames

pathnames

Unix pathnames are always parsed with a unix-host object as the host andnil as the device. The last two dots (.) in the namestring mark the type and version, however if the first character is a dot, it is considered part of the name. If the last character is a dot, then the pathname has the empty-string as its type. The type defaults to nil and the version defaults to :newest.

(defun parse (x) (values (pathname-name x) (pathname-type x) (pathname-version x)))

(parse "foo") $\Rightarrow$"foo", NIL, :NEWEST (parse "foo.bar") $\Rightarrow$"foo", "bar", :NEWEST (parse ".foo") $\Rightarrow$".foo", NIL, :NEWEST (parse ".foo.bar") $\Rightarrow$".foo", "bar", :NEWEST (parse "..") $\Rightarrow$".", "", :NEWEST (parse "foo.") $\Rightarrow$"foo", "", :NEWEST (parse "foo.bar.1") $\Rightarrow$"foo", "bar", 1 (parse "foo.bar.baz") $\Rightarrow$"foo.bar", "baz", :NEWEST

The directory of pathnames beginning with a slash (or a search-list, see section search-lists) is starts :absolute, others start with:relative. The .. directory is parsed as :up; there is no namestring for :back:

(pathname-directory "/usr/foo/bar.baz") $\Rightarrow$(:ABSOLUTE "usr" "foo") (pathname-directory "../foo/bar.baz") $\Rightarrow$(:RELATIVE :UP "foo")


next up previous contents index
Next: Wildcard Pathnames Up: Pathnames Previous: Pathnames   Contents   Index
Peter Van Eynde 2000-02-08