 
 (defn path-map
   "Return map of file basename to full path for all files in `dir`."
-  ([dir] (path-map (path-fs dir) dir))
+  ([dir] (let [dir (path dir)] (path-map (path-fs dir) dir)))
   ([fs dir]
      (let [dir (path dir)]
        (->> (.listStatus ^FileSystem fs dir)


(defn path-glob
  "Expand path glob `p` to set of matching paths."
  ([p] (path-glob (path-fs p) p))
  ([fs p]
     (->> (.globStatus ^FileSystem fs (path p))
          (map #(.getPath ^FileStatus %)))))

(defn path-list
  "List the entries in the directory at path `p`."
  ([p] (path-list (path-fs p) p))
  ([fs p]
     (->> (.listStatus ^FileSystem fs (path p))
          (map #(.getPath ^FileStatus %) ))))

(defn path-delete
  "Recursively delete files at path `p`."
  ([p] (path-delete (path-fs p) p))
  ([fs p] (.delete ^FileSystem fs (path p) true)))

(defn path-exists?


(defn path-create
  "Create an output stream on `p` for `fs`, or default `fs` if not provided."
  ([p] (let [p (path p)] (path-create (path-fs p) p)))
  ([fs p] (.create ^FileSystem fs (path p))))

(extend Path
