def areFilesIdentical(path1, path2, blockSize):
    """Returns true if both files contain identical data. Will check data in increments of blockSize."""
    with open(path1, 'rb') as f1:
        with open(path2, 'rb') as f2:
            while True:
                block1 = f1.read(blockSize)
                block2 = f2.read(blockSize)
                
                if block1 != block2:
                    return False
                
                if len(block1) == 0:
                    break
    
    return True