Skip to content

Instantly share code, notes, and snippets.

View puumCore's full-sized avatar
🏠
Working from home

Mandela Murithi (Puum Core) puumCore

🏠
Working from home
View GitHub Profile
@yangkun
yangkun / file_list.groovy
Created April 4, 2013 17:03
[groovy] list dirs/files (dir first and sort as name)
import groovy.io.*
def listfiles(dir) {
dlist = []
flist = []
new File(dir).eachDir {dlist << it.name }
dlist.sort()
new File(dir).eachFile(FileType.FILES, {flist << it.name })
flist.sort()
return (dlist << flist).flatten()