Posted By

karelklic on 02/27/08


Tagged

file delete


Versions (?)

Delete non-zip files in a directory recursively


 / Published in: Groovy
 

Very basic but I use various variations all the time.

  1. new File(args[0]).eachFileRecurse() { f ->
  2. if (f ==~ /.*zip$/ || !f.isFile()) return
  3. f.delete()
  4. println f.toString() + " removed"
  5. }

Report this snippet  

You need to login to post a comment.