Recursively delete all the files in f, but not f itself.
Raise an exception if any deletion fails unless silently is true.
(defn empty-directory
"Recursively delete all the files in f, but not f itself.
Raise an exception if any deletion fails unless silently is true."
[f & [silently]]
(let [f (file f)]
(when (.isDirectory f)
(doseq [child (.listFiles f)]
(delete-file-recursively child silently)))))
Comments top
No comments for empty-directory. Log in to add a comment.