(defun* tmpize-pathname (x)
(add-pathname-suffix x "-ASDF-TMP"))
+(defun* rename-file-overwriting-target (source target)
+ #+clisp ;; But for a bug in CLISP 2.48, we should use :if-exists :overwrite and be atomic
+ (posix:copy-file source target :method :rename)
+ #-clisp
+ (rename-file source target
+ #+clozure :if-exists #+clozure :rename-and-delete))
+
(defun call-with-staging-pathname (pathname fun)
"Calls fun with a staging pathname, and atomically
renames the staging pathname to the pathname in the end.
(unwind-protect
(multiple-value-prog1
(funcall fun staging)
- (rename-file staging pathname #+clozure :if-exists #+clozure :rename-and-delete))
+ (rename-file-overwriting-target staging pathname))
(when (probe-file* staging)
(delete-file staging)))))