           outs   (map #(srcdir->outdir % src dest) files)]
       (mapv copy-with-lastmod (map io/file files) (map io/file outs)))))
 
-(defn files-for [& dirs]
+(defn tree-for [& dirs]
   (->> (for [dir dirs]
          (let [path  (-> (if (string? dir) dir (.getPath dir)) (.replaceAll "/$" ""))
                snip  (count (str path "/"))]

        [:cp x a]))))

(defn sync! [pred dest & srcs]
  (let [before (files-for dest)
        after  (apply files-for srcs)]
    (doseq [[op p x] (patch pred before after)]
      (case op
        :rm (io/delete-file x true)

                        {}))))
       (reduce (partial merge-with into) {})))

(defn time-diff [before after]
  ((fn [[b a]] [(set/difference b a) a])
   (->> (data/diff (:time before) (:time after)) (take 2) (map (comp set keys)))))

(defmulti  patch-cp? (fn [pred a b] pred))
(defmethod patch-cp? :default [_ a b] true)
