Hi, does anyone see anything wrong with this?
=> (source clojure.java.io/delete-file)
(defn delete-file
"Delete file f. Raise an exception if it fails unless silently is true."
{:added "1.2"}
[f & [silently]]
(or (.delete (file f))
silently
(throw (java.io.IOException. (str "Couldn't delete " f)))))
nil
If you don't already, see below:
=> (.delete (q/newClass java.io.File "a.tx1"))
false
=> (.delete (q/newClass java.io.File "c:\\a.tx1"))
true
=> (clojure.java.io/delete-file (new java.io.File "c:\\a.tx1"))
IOException Couldn't delete c:\a.tx1 clojure.java.io/delete-file(io.clj:425)
=> (clojure.java.io/delete-file (new java.io.File "c:\\a.tx1") true)
true
=> (clojure.java.io/delete-file (new java.io.File "c:\\a.tx1") 1)
1
Yep, I do need it to return the true/false status from .delete
fix?
=> *clojure-version*
{:major 1, :minor 5, :incremental 0, :qualifier "RC14"}
--
Please correct me if I'm wrong or incomplete,
even if you think I'll subconsciously hate it.
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.