def cmpfiles(a, b, common, shallow=True):
 res = ([], [], [])
 for x in common:
  ax = os.path.join(a, x)
  bx = os.path.join(b, x)
  res[_cmp(ax, bx, shallow)].append(x)
 return res

def cmpfiles ( a , b , common , shallow = True ) : res = ( [ ] , [ ] , [ ] ) for x in common : ax = os . path . join ( a , x ) bx = os . path . join ( b , x ) res [ _cmp ( ax , bx , shallow ) ] . append ( x ) return res
compare common files in two directories .