I am trying to write a program that compares the files of 2 directories. I am having all sorts of troubles even planning, so I'm just going to directly ask my questions:
- How would I iterate through the directories?
- What if there are sub-directories within each directory?
- How would I do the comparison?
I'd want the program to start from the 1st file in dir A, look for the same file in dir B, if the file is there then compare and output the result, if the file isn't in dir B then again print out something. This should occur for every file and folder within A.
To elaborate on the 3rd question, I've got to use some sort of encryption tool to do the comparison, so I pick MD5. But I don't know how to use it in C++. Like, how would I apply a MD5 checksum to the content of a binary file?
Btw, the files in the folders are mixed (i.e. txt, exe, dat, doc, html, etc)
Any help is greatly appreciated.