How to compare to directories?

Rob Wolfe blue99 at interia.pl
Wed Sep 13 03:24:01 EDT 2006


could.net at gmail.com 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?
>
> So, how can I do it in python?

Here is a nice example:

http://docs.python.org/lib/os-file-dir.html

Look for description of function walk.

HTH,
Rob




More information about the Python-list mailing list