                    :let [path (util/normalize-to-unix-path (.getAbsolutePath f))]]
                (-rename-file-or-dir path (merge-paths path old-path new-path))))))
 
+(defn- file-or-symlink-exists? [path]
+  (let [f (File. path)]
+    (if (.exists f)
+      path
+      (let [p (.toPath f)]
+        (when (Files/isSymbolicLink p)
+          (let [target (Files/readSymbolicLink p)]
+            (when (.. target toFile exists)
+              path)))))))
+
 (defn- -rename-file-or-dir [old-path new-path]
   (let [affected-files  (if (fs/directory? old-path)
                           (rename-dir old-path new-path)

(ns refactor-nrepl.rename-file-or-dir
  (:require [clojure.string :as str]
            [me.raynes.fs :as fs]
            [clojure.tools.namespace.file :as file]
            [refactor-nrepl.ns
             [helpers :refer [file-content-sans-ns read-ns-form]]
             [ns-parser :as ns-parser]
             [pprint :refer [pprint-ns]]
             [tracker :as tracker]
             [rebuild :refer [rebuild-ns-form]]]
            [refactor-nrepl.util :as util])
  (:import java.io.File
           java.util.regex.Pattern))

(declare -rename-file-or-dir)

         distinct
         (map util/normalize-to-unix-path)
         (remove fs/directory?)
         (filter file-or-symlink-exists?)
         doall)))

(defn rename-file-or-dir
