if(this.args.length){
dir = new File(this.args[0])
if(dir.exists() && dir.directory){
dir.eachDirRecurse{it ->
it.listFiles().each{ f->
if(!f.directory){
println f.absolutePath;
}
}
}
} else {
println "${this.args[0]} is not a directory."
}
} else {
println "Use: groovy ListFile.groovy <dir>"
}
时间: 2024-10-05 15:59:37