How to compare to directories?

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Wed Sep 13 09:21:24 CEST 2006


In <1158127776.413699.170750 at e63g2000cwd.googlegroups.com>, could.net
wrote:

> I want to compare 2 directories: dir1 and dir2.
> What I want to do is to get these informations:
> 1. does they have the same number of files and sub-directories?
> 2. does each file with the same name have the same size and date
> information?

I think `os.listdir()` and the functions in `os.path` will be the tools
you need.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list