如何更改SBCL的当前目录?
更改CLisp当前工作目录非常容易:
>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")
但是,SBCL中似乎没有cd
类似的功能。如何使用 SBCL 来完成此操作?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
现在,更好的答案是:使用
(uiop:chdir "some/path")
。或者您可以使用此功能临时更改目录:
(uiop:调用当前目录“某些/路径”
(拉姆达()
(做该工作))
或者使用这个宏更方便:
(uiop:with-当前目录(“某些/路径”)
(做该工作))
Right now, better answer is: use
(uiop:chdir "some/path")
.Or you can use this function to change directory temporarily:
(uiop:call-with-current-directory "some/path"
(lambda ()
(do-the-job))
Or this macro for more convenient way:
(uiop:with-current-directory ("some/path")
(do-the-job))
有同样的问题。结果将
加载路径更改为子目录。如果你不需要相对路径,那么
Had the same question. Turns out
changes load path to subdir. If you don't want relative path, then
现在我使用rlwrap来运行SBCL并解决这个问题
然后运行
sb
。Now i use rlwrap to run SBCL and solves this problem
then run
sb
.