Created
March 5, 2015 02:38
-
-
Save welshstew/462a0e699a90b4b69ab4 to your computer and use it in GitHub Desktop.
Groovy script to print files recursively (most recent file first)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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