How to change SBCL's current directory?

z_axis picture z_axis · Oct 12, 2011 · Viewed 8.8k times · Source

It is very easy to change CLisp's current working directory:

>cat ~/.clisprc.lisp 
;;; The following lines added by ql:add-to-init-file:
#-quicklisp
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" (user-homedir-pathname))))
  (when (probe-file quicklisp-init)
  (load quicklisp-init)))

(cd "/media/E/www/qachina/db/doc/money")
(load "money")

However, it seems there is no cd similar function in SBCL. How can this be done with SBCL?

Answer

peroksid picture peroksid · Oct 7, 2013
CL-USER> (sb-posix:chdir "/home/apugachev")
0
CL-USER> (sb-posix:getcwd)
"/home/apugachev"
CL-USER> (sb-posix:chdir "/tmp/")
0
CL-USER> (sb-posix:getcwd)
"/tmp"