Skip to content

Instantly share code, notes, and snippets.

@welshstew
Created March 5, 2015 02:38
Show Gist options
  • Save welshstew/462a0e699a90b4b69ab4 to your computer and use it in GitHub Desktop.
Save welshstew/462a0e699a90b4b69ab4 to your computer and use it in GitHub Desktop.
Groovy script to print files recursively (most recent file first)
import groovy.io.FileType
def list = []
def dir = new File(".")
dir.eachFileRecurse (FileType.FILES) { file ->
list << file
}
def ascendingOrder = list.sort { it.lastModified() }
def descending = ascendingOrder.reverse()
print descending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment