Posted By

alces on 02/06/13


Tagged

file delete groovy eachFile


Versions (?)

Recursive delete current directory


 / Published in: Groovy
 

URL: groovy_rm_rf

Safe way to recursive delete directory

  1. deltree = {f ->
  2. if (f.directory) f.eachFile {deltree(it)}
  3. f.delete()
  4. }
  5. deltree(new File('.'))

Report this snippet  

You need to login to post a comment.