Replacement function for delete-files-recursively in java-utils

464 views
Skip to first unread message

Raju Bitter

unread,
May 18, 2012, 6:44:38 PM5/18/12
to Clojure
I noticed that the function delete-file-recursively is present in
clojure-contrib java-utils package, but it's missing in
clojure.java.io. Is there any other function for deleting a directory
recursively?
http://richhickey.github.com/clojure-contrib/java-utils-api.html#clojure.contrib.java-utils/delete-file-recursively

Thanks,
Raju

Phil Hagelberg

unread,
May 18, 2012, 6:50:40 PM5/18/12
to clo...@googlegroups.com
It was left out of clojure.java.io because in Java 6 there's no way to
detect whether a given directory is actually a symlink, so it has to
recurse into symlinked directories indiscriminately. This behaviour is
arguably dangerous. Perhaps in the far future it could be added once
support for Java 6 is dropped.

-Phil

Raju Bitter

unread,
May 18, 2012, 7:06:33 PM5/18/12
to clo...@googlegroups.com
Right, that makes sense. Thanks for the clarification!

- Raju
Reply all
Reply to author
Forward
0 new messages