It compare files in root of two folders and generate a html report based on the files compared along with diff files.
Q. Why I created this utility.
It was created to compare text files at the root of two folders with same name and generate a HTML report on its
finding and along with diff files in specified report folder
Q. What do you mean by root of two folders
It means it will not traverse inside the folders and will only check for the files at the base of both the folders and
not in any subdirectories.
If you have a need for such feature, just ping me and I will add the feature.
Q. How do I use it
The first step is to create a configuration file, I have added a configuration file (opt.conf) as sample.
It contains of 5 parameters.
[conf]
old_folder:/home/mayank/working/junk/1
new_folder:/home/mayank/working/junk/2
report_folder:/home/mayank/working/junk/report/
diff_type:ndiff
helpers:20
old_folder and new_folder contains the paths of two folder to be compared.
report_folder is the location where the report files will be copied
diff_type is the type of diff files you want, options are diff, ndiff, html, play around them to know the difference.
Helpers: maximum number of threads which will be created by program while checking the files for differences.
Once the file is created you can execute the script by calling the following command
python cmpfiles.py -c opt.cont
after the execution is completed, open the report.html files from the report folder you have mentioned in the
configuration file to view the results.
Q. I found a bug or needs a feature
Use the sourceforge.net bug / feature option from https://sourceforge.net/p/pyfoldercompare/tickets/?source=navbar.
I will try to add the feature, but no promises.
Q. What are the modules it needs to run
look at the import modules in the code.
Some of the python modules are as follows:
os, sys, shutil, difflib, filecmp, optparse, ConfigParser, multiprocessing, json and operator