How filecmp walk into subdirectories?

M

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
 
J

John Gordon

In said:
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().
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top