                  (completed [res att]
                    (let [bais (ByteArrayInputStream. (.array bb))]
                      (try
-                       (copy-fn {:input-stream bais
+                       (locked-cb {:input-stream bais
                                  :size (.length f)
                                  :file f})
                        (catch Exception e

                               :key       key
                               :exception e}))))))

(defn- read-binary-old [f folder fn key copy-fn]
  (let [res-ch-old (chan)]
    (try
      (let [ac (AsynchronousFileChannel/open (.getPath (FileSystems/getDefault)

(defn delete-store
  "Permanently deletes the folder of the store with all files."
  [folder]
  (let [f (io/file folder)
        parent-folder (.getParent f)]
      (doseq [path [(str folder "/meta") (str folder "/data") folder]]
        (doseq [c (.list (io/file path))]
          (.delete (io/file (str path "/" c)))))
      (.delete f)
      (try
        (sync-folder parent-folder)
        (catch Exception e
          nil))))

(defn list-keys
  "Lists all keys in this binary store. This operation *does not block concurrent operations* and might return an outdated key set. Keys of binary blobs are not tracked atm."
