Question

Is there any tool, which can compare 2 directories( with different sub dirs) for same named files?

Eg. DirA has subdir DirA1, DirA1 has one file named file.cpp.

DirB has file.cpp.

Dira->DirA1->file.cpp and DirB->file.cpp.

So, iF i compare these 2 dirs with BC, BC doesnt compare these 2 files. It'll mark them as orphans on both sides.

Can we write any BC script to compare these two files?

PS: I could have 10-100 files in both folders to compare. The point is how to make the comparison tool look for matching file names, irrespective of dir level.

I hope my question makes sense here.

Était-ce utile?

La solution

Beyond Compare 3 has an option in the View menu (Ignore Folder Structure) that does exactly what you want. It iterates over all of the subfolders for every file and displays them in a single level with files aligned based on names. If there happen to be multiple files with the same name it will give priority to aligning ones with the same directory structure.

Autres conseils

Short of writing scripts, here's quick and dirty way to achieve that:

  1. Create two temporary directories - FlatA and FlatB.
  2. Zip both original directories DirA and DirB into separate zip files - ArchiveA.zip and ArchiveB.zip
  3. Unzip both archives into FlatA and FlatB respectively, without paths.
  4. Use BeyondCompare to compare "flattened" folders FlatA and FlatB
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top