X-Git-Url: https://git.distorted.org.uk/~mdw/lisp/blobdiff_plain/6e1633e7a77cd38b1aff25196867b17e4d4a6c00..562ed2ddc451abe9be0ec5bb9684b2df56942d8f:/safely.lisp diff --git a/safely.lisp b/safely.lisp index 13671a4..9809f07 100644 --- a/safely.lisp +++ b/safely.lisp @@ -112,8 +112,10 @@ (declaim (inline rename)) (defun rename (old new) - #-clisp (rename-file old 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."