List directory contents
This lists all files in a directory.
new File("test").eachFile() { file->
println file.getName()
}
“bar” and “foo” are directories, test.txt is a file.
bar foo test.txt
This lists all files in a directory.
new File("test").eachFile() { file->
println file.getName()
}
“bar” and “foo” are directories, test.txt is a file.
bar foo test.txt