Merging Lisp pathnames
... a very short article today, about Common Lisp and pathnames... a topic which I already wrote about in Common Lisp for shell scripting.
What I did leave out is... a bunch of pathname operations that might be useful. For example, merging pathnames with different components:
CL-USER> (merge-pathnames #P"/some/directory/" #P"file.name") #P"/some/directory/file.name"
... which is, actually, not really a generic pathname join: it takes the directory component out of one pathname and the file name one from another. Weirdly, to combine different directories, we need actual libraries... which seem to be around by default anyway:
CL-USER> (cl-fad:merge-pathnames-as-directory #P"/the/root/" #P"some/other/path/") #P"/the/root/some/other/path/"