Recursive delete current directory


/ Published in: Groovy
Save to your folder(s)

Safe way to recursive delete directory


Copy this code and paste it in your HTML
  1. deltree = {f ->
  2. if (f.directory) f.eachFile {deltree(it)}
  3. f.delete()
  4. }
  5. deltree(new File('.'))

URL: groovy_rm_rf

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.