summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStuart Halloway <stu@thinkrelevance.com>2010-05-13 22:41:59 -0400
committerStuart Halloway <stu@thinkrelevance.com>2010-05-20 21:25:19 -0400
commit56dd2cd8714e30d85a215d520b0248f4783fbbbd (patch)
tree5a87684d6df05e6ac15cc7a604a58da995329688 /src
parent65b7e698c508658b6e2af1dedca999649c0f1f56 (diff)
more code review of #311
- better docstring - so long dangerous recursive delete, we hardly knew ye Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
Diffstat (limited to 'src')
-rw-r--r--src/clj/clojure/java/io.clj15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/clj/clojure/java/io.clj b/src/clj/clojure/java/io.clj
index ec2404f8..97ae4e3e 100644
--- a/src/clj/clojure/java/io.clj
+++ b/src/clj/clojure/java/io.clj
@@ -412,20 +412,9 @@
silently
(throw (java.io.IOException. (str "Couldn't delete " f)))))
-(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."
- {:added "1.2"}
- [f & [silently]]
- (let [f (file f)]
- (if (.isDirectory f)
- (doseq [child (.listFiles f)]
- (delete-file-recursively child silently)))
- (delete-file f silently)))
-
(defn make-parents
- "Create all parent directories of file. Pass extra args
- as you would to file."
+ "Given the same arg(s) as for file, creates all parent directories of
+ the file they represent."
{:added "1.2"}
[f & more]
(.mkdirs (.getParentFile ^File (apply file f more))))