symlinks

Using Clojure to Delete Directories Containing Symlinks

As part of repository maintenance, I often use a script to delete a group of directories, even if those directories are not empty. It looks something like this: (require '[clojure.java.io :as io]) . . . (defn delete-children-recursively! [f] "Given a file, delete it. If the file is a directory delete its contents first. This version does not handle symlinks." (when (.isDirectory f) (doseq [f2 (.listFiles f)] (delete-children-recursively!