Extend a relative pathname to an absolute pathname
General Form: (extend-pathname dir filename state)
where
The following examples illustrate the behavior of
Examples (comments added) ACL2 !>(extend-pathname "~/temp" "foo.lisp" state) ; where the user is "bubba" here and in the remaining examples "/home/bubba/temp/foo.lisp" ACL2 !>(extend-pathname "~/temp/" "foo.lisp" state) ; the final / is optional for the directory name "/home/bubba/temp/foo.lisp" ACL2 !>(extend-pathname "~/temp/" "no-such-file" state) ; name of non-existent file is still extended "/home/bubba/temp/no-such-file" ACL2 !>(extend-pathname "." "no-such-file" state) ; THIS IS NOT SUPPORTED, because the first argument is a relative pathname, ; not an absolute pathname; but in this case a reasonable answer happens to ; be provided. See the next example for how to do this properly. ; Here we assume that the current working directory is "/home/joe" "/home/joe/no-such-file" ACL2 !>(extend-pathname (canonical-pathname "." t state) "no-such-file" state) ; As above, but the first argument is first turned into an absolute pathname, ; which makes the call a supported one. "/home/joe/no-such-file" ACL2 !>(extend-pathname (cbd) "no-such-file" state) ; assumes that the connected book directory (see :DOC cbd) is "/data/santa" "/data/santa/no-such-file" ACL2 !>(extend-pathname :system "no-such-file" state) ; assumes that system books directory is "/data/acl2/books" "/data/acl2/books/no-such-file" ACL2 !>(extend-pathname "/data/acl2" "~/temp/foo.lisp" state) ; directory is ignored when filename is already absolute "/home/bubba/temp/foo.lisp" ACL2 !>(extend-pathname :system "~/temp/foo.lisp" state) ; directory is ignored when filename is already absolute "/home/bubba/temp/foo.lisp"
Note that when the indicated file exists,