diff --git a/uiop/filesystem.lisp b/uiop/filesystem.lisp
index d7b36549a8353e20db83495876285acae40f557b..422767f1a033402c2cfe654fe130c932f607b372 100644
--- a/uiop/filesystem.lisp
+++ b/uiop/filesystem.lisp
@@ -578,6 +578,10 @@ NILs."
       (when pathname
         (ensure-directories-exist (physicalize-pathname pathname)))))
 
+  (defun delete-file-if-exists (x)
+    "Delete a file X if it already exists"
+    (when x (handler-case (delete-file x) (file-error () nil))))
+
   (defun rename-file-overwriting-target (source target)
     "Rename a file, overwriting any previous file with the TARGET name,
 in an atomic way if the implementation allows."
@@ -589,10 +593,6 @@ in an atomic way if the implementation allows."
     (rename-file source target
                  #+(or clasp clozure ecl) :if-exists #+clozure :rename-and-delete #+(or clasp ecl) t))
 
-  (defun delete-file-if-exists (x)
-    "Delete a file X if it already exists"
-    (when x (handler-case (delete-file x) (file-error () nil))))
-
   (defun delete-empty-directory (directory-pathname)
     "Delete an empty directory"
     #+(or abcl digitool gcl) (delete-file directory-pathname)