filecmp.cmpfiles on directories

Stormin storminDOTnorm at excite.com
Tue Jun 11 15:01:47 EDT 2002


Hi python pros!

I am trying to walk a directory structure and compare directories for 
duplicates.  For some reason I get the filecmp to work on individual 
files, but not on directories.
note: I tried also with double backslash and with backslashes at the end 
of the directory name - no go. (i.e. c:\\comp1\\)

example:
DOES NOT WORK:
dups=filecmp.cmpfiles("C:\comp1","c:\comp2",common)
print dups,"||",common
result:
([],[],[])||

WORKS:
dups=filecmp.cmp("c:\comp1\testfile.txt","c:\comp1\testfile.txt")
print dups
result:
1





More information about the Python-list mailing list