Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
There's an interesting discussion here...
http://wiki.codehaus.org/groovy/FileSupport
one thought was recursive deletion...
def recursiveDelete(File file) {
outer = this
if( file.isDirectory() ) {
file.eachFile
}
file.delete()
}
I wondered if we should have a recursive file method where you could do
new File("/home/foo").eachFileRecurse
{ println it.name }which would iterate through all files recursively like the above - calling children first before parents.
Then a recursive delete would be
file.eachFileRecurse
{ it.delete() }