Best way to compare the contents of two directories

Raymond Hettinger vze4rx4y at verizon.net
Mon Sep 13 04:06:17 EDT 2004


[Robin Siebler]
> However, before I actually compare the files, I want to compare the
> directories and if a directory is mising in either set, I want to
> report it:

The operative word is "set".

Try using sets.py:
     one_only = Set(dirlistone) - Set(dirlisttwo)
     two_only = Set(dirlisttwo) - Set(dirlistone)


Raymond Hettinger





More information about the Python-list mailing list