Windows 8.1 SBCL 1.3.18 can't rename local-projects system-index.txt

Skip to first unread message


Oct 17, 2017, 4:49:26 PM10/17/17
to Quicklisp
I have Allegro, Lispworks, and SBCL on my Windows 8.1 machine, and several modules in ~/quicklisp/local-projects.  Allegro and Lispworks start fine, but I am unable to start SBCL because it tries to rename system-index.txt.

My .sbclrc contains

;;; The following lines added by ql:add-to-init-file:
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp"
  (when (probe-file quicklisp-init)
    (load quicklisp-init)))

;;; Load cs325.lisp to create the cs325 package.

(eval-when (:compile-toplevel :load-toplevel :execute)
  (ql:quickload "cs325")
  (setq *package* (find-package :cs325-user)))

When I open a command prompt and run SBCL I get

debugger invoked on a SB-INT:SIMPLE-FILE-ERROR in thread
#<THREAD "main thread" RUNNING {1002DBA963}>:
  couldn't rename
      The process cannot access the file because it is being used by another process.

There is no system-index.txt.bak file, and this happens when I've just restarted my machine, no other Lisp is running, nothing that I can think of using system-index.txtsystem-index.txt is not read-only. I tried running cmd.exe as administrator. Same error.

What else should I be checking for or trying?

Zach Beane

Oct 17, 2017, 4:58:25 PM10/17/17
to quicklisp
Hmm! I think that .bak comes from this code:

    (defun make-system-index (pathname)
      "Create a system index file for all system files under
    PATHNAME. Current format is one native namestring per line."
      (setf pathname (truename pathname))
      (with-open-file (stream (system-index-file pathname)
      :direction :output
      :if-exists :rename-and-delete)
(dolist (system-file (local-project-system-files pathname))
  (let ((system-path (enough-namestring system-file pathname)))
    (write-line (native-namestring system-path) stream)))
(probe-file stream)))

I suspect SBCL's implementation of :if-exists :rename-and-delete is introducing the .bak pathname.

But I don't know why it would signal that error - is it possible to reproduce the error with a simpler :if-exists :rename-and-delete example? Perhaps there is an SBCL issue in play here.


You received this message because you are subscribed to the Google Groups "Quicklisp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
For more options, visit


Oct 18, 2017, 11:46:02 AM10/18/17
to Quicklisp
I played with simple rename/delete calls to ~/foo.txt and then ~/quicklisp/local-projects/system-index.txt

All worked, so I tried (quicklisp-client::make-system-index "~/quicklisp/local-projects/") and that worked.

So I quit SBCL and tried, and now SBCL starts OK. So something changed during the experiments but I have no idea.

If the problem returns, I'll explore and report if I have any more clues.



Aug 4, 2023, 2:40:53 PM8/4/23
to Quicklisp
FYI, almost six years later, I ran into the exact same error again while setting up fresh installs of Allegro, Lispworks, and SBCL 2.3.2, in that order, on a new Windows 11 machine. Allegro and Lispworks were happy, SBCL got the rename error.

Running (quicklisp-client::make-system-index "~/quicklisp/local-projects/") in Lisp seemed to clear the problem without breaking Allegro and Lispworks, so at least that's a workaround.
Reply all
Reply to author
0 new messages