A small directory comparison script
This only works on a flat file structure no subdirs.The comparison is only one way.
Files thats found in new will be copied to a separate directory
import filecmp
import shutil
old = "/tmp/old/"
new = "/tmp/new/"
diff_new = "/tmp/diff/"
new_list = filecmp.dircmp(old,new).right_only
for newfile in new_list:
shutil.copy(new+newfile,diff_new+newfile)
No comments:
Post a Comment