~mdw
/
lisp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
safely.lisp: CLisp's POSIX:COPY-FILE :METHOD :RENAME is a disaster.
[lisp]
/
safely.lisp
diff --git
a/safely.lisp
b/safely.lisp
index
13671a4
..
9809f07
100644
(file)
--- a/
safely.lisp
+++ b/
safely.lisp
@@
-112,8
+112,10
@@
(declaim (inline rename))
(defun rename (old new)
(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."
(defun delete-file-without-moaning (file)
"Delete the FILE, ignoring errors."