   [^File file marker]
   (if (.isDirectory file)
     (->> (.listFiles file)
-         (filter #(re-matches #"^[0-9a-f]+$" (.getName ^File %)))
          (keep (partial seek-marker marker))
          (sort-by first)
          (keep (partial apply find-files))

  Using this scheme, leaf directories should start approaching the limit once the
  user has 2^28 entries, or about 268 million blocks."
  (:require
    [blocks.core :as block]
    [blocks.data :as data]
    [clojure.java.io :as io]
    [clojure.string :as str]
    [multihash.core :as multihash])
  (:import
    java.io.File


(defn- file->id
  "Reconstructs the hash identifier represented by the given file path."
  [root ^File file]
  (let [root (str root)]
    (some->
      file
      (.getPath)
      (util/check #(.startsWith ^String % root)
        (log/warnf "File %s is not a child of root directory %s" file root))
      (subs (inc (count root)))
      (str/replace "/" "")
      (util/check util/hex?
        (log/warnf "File %s did not form valid hex entry: %s" file value))
      (multihash/decode))))


(defn- file->block
