Returns the size of the file or directory in bytes.

def getsize(path, recurse=False):
    """Returns the size of the file or directory in bytes."""
    if not op.isdir(path):
        return op.getsize(path)
    size = 0
    for r,_,fs in os.walk(path):
        for f in fs:
            size += getsize(op.join(r,f))
        if not recurse:
            break
    return size