From 562ed2ddc451abe9be0ec5bb9684b2df56942d8f Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Thu, 9 Jun 2011 15:06:25 +0100 Subject: [PATCH] safely.lisp: CLisp's POSIX:COPY-FILE :METHOD :RENAME is a disaster. It seems to do two separate pathname merges. Use RENAME-FILE instead: it may be mad, but at least it's mad in a well-understood way. We still need :IF-EXISTS :OVERWRITE because CLisp makes life unnecessarily difficult. --- safely.lisp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/safely.lisp b/safely.lisp index 69fceed..9809f07 100644 --- a/safely.lisp +++ b/safely.lisp @@ -112,10 +112,10 @@ (declaim (inline rename)) (defun rename (old new) - #-clisp (rename-file old - (make-pathname :directory '(:relative) - :defaults new)) - #+clisp (posix:copy-file old new :method :rename)) + (let ((target (make-pathname :directory '(:relative) + :defaults new))) + #-clisp (rename-file old target) + #+clisp (rename-file old target :if-exists :overwrite))) (defun delete-file-without-moaning (file) "Delete the FILE, ignoring errors." -- 2.11.0