Skip to content

Instantly share code, notes, and snippets.

@copenhas
Created November 3, 2011 18:45
Show Gist options
  • Save copenhas/1337394 to your computer and use it in GitHub Desktop.
Save copenhas/1337394 to your computer and use it in GitHub Desktop.
extension methods!
Directory.EnumerateFiles(_backupdir)
.Select(f => new FileInfo(f))
.Where(f => f.CreationTime < DateTime.Now.AddMonths(-1))
.ForEach(f => f.Delete());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment