Re: Recursively delete files

2009-04-22 Thread Cosmin Stejerean
On Wed, Apr 22, 2009 at 6:30 PM, Phil Hagelberg wrote: > > Yeah, I had originally put this in the clojure.contrib.java-utils > namespace, which defines file. Not sure if that's the best place for it, > but I don't see anything else that would be a better fit. > > This kind of functionality remind

Re: Recursively delete files

2009-04-22 Thread Dimiter "malkia" Stanev
Duh... Ignore me :) - I don't have really an explanation for what I wrote, but I got confused really badly! hehehe On Apr 22, 5:16 pm, "Dimiter \"malkia\" Stanev" wrote: > I think this might come from Common Lisp (or Scheme, not sure). > > In anycase CL also has "unless" which is exactly the opp

Re: Recursively delete files

2009-04-22 Thread Dimiter "malkia" Stanev
I think this might come from Common Lisp (or Scheme, not sure). In anycase CL also has "unless" which is exactly the opposite of "when" - e.g. it would do the "else" part of "if". http://www.lispworks.com/documentation/HyperSpec/Body/m_when_.htm Basically some of the Common Lispers are saying t

Re: Recursively delete files

2009-04-22 Thread Phil Hagelberg
André Thieme writes: > This could really be helpful for some fixtures during unit testing. That's exactly what I'm using it for. =) I think anyone else who has tests that write files is going to need something like this too, which is what made me think it'd be appropriate for contrib. > One mi

Re: Recursively delete files

2009-04-22 Thread e
why is 'when' preferred ... so we know what the considerations are? Thanks On Wed, Apr 22, 2009 at 6:47 PM, André Thieme wrote: > > On 22 Apr., 21:12, Phil Hagelberg wrote: > > I couldn't find an equivalent to "rm -rf" in the JDK, so I wrote these > > functions: > > > > (defn delete-file > >

Re: Recursively delete files

2009-04-22 Thread André Thieme
On 22 Apr., 21:12, Phil Hagelberg wrote: > I couldn't find an equivalent to "rm -rf" in the JDK, so I wrote these > functions: > > (defn delete-file >   "Delete file f. Raise an exception if it fails." >   [f] >   (or (.delete (file f)) >       (throw (java.io.IOException. (str "Couldn't delete "

Recursively delete files

2009-04-22 Thread Phil Hagelberg
I couldn't find an equivalent to "rm -rf" in the JDK, so I wrote these functions: (defn delete-file "Delete file f. Raise an exception if it fails." [f] (or (.delete (file f)) (throw (java.io.IOException. (str "Couldn't delete " f) (defn delete-file-recursively "Delete file f.