显示文件列表的groovy脚本
2009-10-08 00:00:00 来源:WEB开发网核心提示:if(this.args.length){dir=newFile(this.args[0])if(dir.exists()&&dir.directory){dir.eachDirRecurse{it->it.listFiles().each{f->if(!f.directory){printlnf.abso
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>"
}
更多精彩
赞助商链接