How filecmp walk into subdirectories?

2011-11-01 Thread Muddy Coder
Hi Folks,


I tried to compare two directories, each with hundreds of files in
multiple level subdirectories, to find out the different files. I used
filecmp module to the job as:


comp=filecmp.dircmp(adir, bdir)
comp.report()

It worked, and printed out the identical and different files. However,
it did not go through the directory trees, just did the job in the
first level. I wonder somebody can help? Thanks in advance!


Cosmo
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How filecmp walk into subdirectories?

2011-11-01 Thread John Gordon
In d0c0b3f4-ce8b-489f-9334-2b5d807f6...@es7g2000vbb.googlegroups.com Muddy 
Coder cosmo_gene...@yahoo.com writes:

 I tried to compare two directories, each with hundreds of files in
 multiple level subdirectories, to find out the different files. I used
 filecmp module to the job as:

 comp=filecmp.dircmp(adir, bdir)
 comp.report()

 It worked, and printed out the identical and different files. However,
 it did not go through the directory trees, just did the job in the
 first level. I wonder somebody can help? Thanks in advance!

report() only prints information on the first-level contents of the two
directores, as you saw.  It doesn't do subdirectories.

If you want subdirectories, use report_full_closure().

-- 
John Gordon   A is for Amy, who fell down the stairs
gor...@panix.com  B is for Basil, assaulted by bears
-- Edward Gorey, The Gashlycrumb Tinies

-- 
http://mail.python.org/mailman/listinfo/python-list