Skip to content

Instantly share code, notes, and snippets.

@yannick
Created August 15, 2014 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yannick/73da9d81ac3336a823e1 to your computer and use it in GitHub Desktop.
Save yannick/73da9d81ac3336a823e1 to your computer and use it in GitHub Desktop.
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