Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. from filecmp import dircmp
  2. import os
  3.  
  4.  
  5. def print_diff_files(dcmp):
  6.     # for name in dcmp.diff_files:
  7.     #     print("diff_file %s found in %s and %s" % (name, dcmp.left, dcmp.right))
  8.     # for sub_dcmp in dcmp.subdirs.values():
  9.     #     print_diff_files(sub_dcmp)
  10.     print(dcmp.left_only)
  11.     print(dcmp.right_only)
  12.  
  13.     # for file in dcmp.left_only:
  14.     #     os.remove(os.path.join(dcmp.left, file))
  15.     # for file in dcmp.right_only:
  16.     #     os.remove(os.path.join(dcmp.right, file))
  17.  
  18.  
  19. # CHANGE THIS PATHS
  20. dir1 = "/Volumes/Extended/Temp/ffv2/dir1"
  21. dir2 = "/Volumes/Extended/Temp/ffv2/dir2"
  22.  
  23.  
  24. dcmp = dircmp(dir1, dir2)
  25. print_diff_files(dcmp)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement