drdff
is a command-line program that compares two directories and reports which files are missing from each directory. The name is derived from "directories" and "differences", inspired by a drunken night of programming.
drdff
compares the filenames of files in two directories and reports which files are missing from each directory. It does not compare file content using md5
or byteArray
at this time.
The inspiration for creating drdff
came from the need to set up a proper backup pipeline for multiple external hard disk drives. Initially, the author tried using the diff
utility to compare the contents of backup drive directories recursively. However, the process was slow and inefficient, and the author was too lazy to investigate how to properly use the find
utility. Therefore, the author decided to develop their own implementation using Kotlin, OOP, and TDD.
To run the program, you need Java 17 or higher. The executable is a single fat jar
.
To use drdff
, run the following command in your terminal:
java -jar drdff.[version_name].jar [options]
The following options are available:
-d
: Specify the directory to search for in the second directory.-i
: Specify the directory to search for files in the first directory.-o
: Specify the name of the file to store the results.-x
: Specify which file extensions to search for, separated by commas.-s
: Specify the algorithm to use to compare two sets ofStrings
. Currently, onlyIntersect
is supported.-ds
: Specify how to resolve the contents of the given directories. Currently, onlyTreeWalk
is supported.-h
: Show help message.
Here's an example of how to use drdff
to find missing files on an external hard disk drive:
java -jar drdrff.jar -d /media/me/backup1 -i /media/me/backup2 -o /home/me/backup1MissingFromBackup2.txt
This command compares the contents of /media/me/backup1
and /media/me/backup2
, and writes the results to /home/me/backup1MissingFromBackup2.txt
. The output contains useful information like the percentage of files missing and the paths of the missing files.
-
Improve performance by implementing multi-threading for directory resolution and differences computation.
-
Add an option for printing the results to stdout in addition to writing them to a file.
By implementing multi-threading, the program will be able to make better use of available system resources, resulting in faster execution times for large directories.
Adding an option to print results to stdout will provide users with greater flexibility in how they interact with the program, and allow them to easily incorporate it into larger scripts or workflows.
Contributions to drdff
are welcome! If you encounter any bugs or have suggestions for improving the program, please open an issue or submit a pull request.
drdff
is released under the MIT License.
The author would like to thank the open-source community for their contributions to the Kotlin programming language, as well as the creators of the JUnit testing framework.