ryoakg
10/8/2016 - 5:46 AM

file-path.clj

(require '[clojure.java.io :as io])

(let [f (io/file "/etc/rc1.d/../rc0.d/S90halt")]
  [(.getCanonicalPath f) (.getAbsolutePath f) (.getPath f)])
;; => ["/etc/init.d/halt" "/etc/rc1.d/../rc0.d/S90halt" "/etc/rc1.d/../rc0.d/S90halt"]

(let [f (io/file ".")]
  [(.getCanonicalPath f) (.getAbsolutePath f) (.getPath f)])
;; => ["/mnt/HD-GD/a/Dev/clj/test" "/mnt/HD-GD/a/Dev/clj/test/." "."]