Monday, April 18, 2016

Detecting and moving duplicate files with C# Windows Forms

In 2011, I wrote a Perl script that moved mp3 files based on name matching:

Thanks to cloud services such as dropbox, my duplicate-pruning needs have become more complex.
I now have photos and videos coming in from multiple sources that are mostly the same set, but not completely. These sources have different names for the files. On top of that, I don't really benefit from command line interfaces when it comes to routine maintenance of these files.

And so I'm revisiting that problem in 2016 using C# and Windows Forms instead of Perl.

Differences from my previous attempt:
  • Works with any file
  • Uses binary comparisons instead of filename comparisons
  • Human-friendly UI
  • Progress-indicator
  • Optional filter to include or exclude files based on their extension
  • Ability to cancel an operation in progress
  • Preview mode + Log files, in case you just wanted to know the duplicates without moving them
Source code is hosted here:

Windows users who trust me can download the exe here (choose 'View Raw'):