delete-file-recursively

clojure.contrib.java-utils

  • (delete-file-recursively f & [silently])
Delete file f. If it's a directory, recursively delete all its contents.
Raise an exception if any deletion fails unless silently is true.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/java_utils.clj:177 top

(defn delete-file-recursively
  "Delete file f. If it's a directory, recursively delete all its contents.
Raise an exception if any deletion fails unless silently is true."
  {:deprecated "1.2"}
  [f & [silently]]
  (let [f (file f)]
    (if (.isDirectory f)
      (doseq [child (.listFiles f)]
        (delete-file-recursively child silently)))
    (delete-file f silently)))
Vars in clojure.contrib.java-utils/delete-file-recursively: defn doseq let
Used in 0 other vars

Comments top

No comments for delete-file-recursively. Log in to add a comment.