#!/usr/bin/python -tt # vim: fileencoding=utf8 import filecmp import os import tempfile from os.path import join t = tempfile.mkdtemp() os.mkdir(join(t, "a")) os.mkdir(join(t, "b")) f = open(join(t, "a", "testfile"), "wb") f.close() os.chmod(join(t, "a", "testfile"), 0) f = open(join(t, "b", "testfile"), "wb") f.close() e = None try: print filecmp.cmpfiles(join(t, "a"), join(t, "b"), ["testfile"], shallow=False) except Exception, e: pass