;;; ;;; $Header: /home/gene/library/website/docsrc/pathnames-0/RCS/per-user-config.lisp,v 395.1 2008/04/20 17:25:56 gene Exp $ ;;; ;;; Here are some expressions which determine ;;; the pathname of "this" program's ;;; configuration file. For clarity, I'll ;;; make liberal use of temporary variables, ;;; though that is not the usual Lisp style. (defvar *home* (user-homedir-pathname) "User's home directory. We'll borrow the Unix convention that configuration files live in a user's home directory.") (defvar *name* "myprog" "The name of the configuration file. It might be a good idea if it has the same name as the program. If we stuck strictly with the Unix convention, it would begin with a dot, but that isn't portable to all file systems, \& it might give the pathname functions of some Lisps a heart-attack.") (defvar *type* "rc" "The type of the configuration file. Could be nearly anything. For portability, it's safest to have a file type, \& there is precedent for rc.") (defvar *basepath* (make-pathname :name *name* :type *type* :version :newest) "We'll create the config file's actual pathname by merging this with the pathname of the user's home directory.") (defvar *config* (merge-pathnames *basepath* *home*) "And now *CONFIG* is bound to the pathname of the config file.") (format t "~&~A" (namestring *config*)) ;;; --- end of file ---