Moved rename-file-overwriting-target to asdf and asdf-utils.
authorFrancois-Rene Rideau <tunes@google.com>
Wed, 26 Dec 2012 20:35:27 +0000 (15:35 -0500)
committerFrancois-Rene Rideau <tunes@google.com>
Wed, 26 Dec 2012 20:35:27 +0000 (15:35 -0500)
filesystem/atomic.lisp
package.lisp

index 957c49c..4523de6 100644 (file)
@@ -5,13 +5,6 @@
 
 (in-package #:fare-utils)
 
-(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 make-tmpname-for (filename)
   (make-pathname
    :type (conc-string (pathname-type filename)
     (unwind-protect
          (prog1
              (funcall fun s)
-           #+clisp
-           (posix:copy-file tmpname filename :method :rename)
-           #-clisp
-           (rename-file tmpname filename #+clozure :if-exists #+clozure :overwrite))
+           (rename-file-overwriting-target tmpname filename))
       (ignore-errors (delete-file tmpname) nil))))
 
 (defmacro with-atomic-file-creation ((s filename &optional tmpname) &body body)
index ead8cb2..70f15bf 100644 (file)
    ;;#:ensure-absolute-pathname ;; use ASDF:ENSURE-PATHNAME-ABSOLUTE
    #:portable-namestring-prefix<=
    ;;#:ensure-pathname-is-directory
-   #:rename-file-overwriting-target
    #:unwilden
    #:append1 #:append1f #:funcallf ;; #:appendf #:nconcf
    #:with-nesting #:nest #:tsen