Created
August 15, 2014 15:11
-
-
Save yannick/02cb0a53bf8e870b98d7 to your computer and use it in GitHub Desktop.
This file contains 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 std.stdio; | |
import std.file, std.algorithm, std.datetime, std.range; | |
void main() { | |
DirEntry[] allFiles; | |
foreach(DirEntry entry; dirEntries("/home/yannick", SpanMode.depth)){ | |
allFiles ~= entry; | |
} | |
auto sorted = sort!((a, b) => a.size > b.size)(allFiles); | |
auto filtered = filter!((a) => (Clock.currTime() - a.timeLastModified) > 14.days)(sorted); | |
foreach(file; filtered.take(10)) { | |
writeln(file); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment