chiark / gitweb /
safely.lisp: Fix RENAME to cope with nontrivial directory components.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 5 Jun 2011 00:07:44 +0000 (01:07 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 5 Jun 2011 00:07:44 +0000 (01:07 +0100)
The mad Lisp RENAME-FILE rules strike again.

safely.lisp

index 13671a4698df327efcfc59696ff305559e4ca991..69fceed1076160e62343a0b3a8e6b71e5176fefe 100644 (file)
@@ -112,7 +112,9 @@ (defun safely-open-output-stream (safe file &rest open-args)
 
 (declaim (inline rename))
 (defun rename (old new)
-  #-clisp (rename-file old new)
+  #-clisp (rename-file old
+                      (make-pathname :directory '(:relative)
+                                     :defaults new))
   #+clisp (posix:copy-file old new :method :rename))
 
 (defun delete-file-without-moaning (file)