def gpfInfo(fileName):
    """
    Get information on a gpc/gpf file.

    :Arguments:
        - fileName: name of the file to read
    :Returns:
        - contours: number of contours
        - holes: number of holes (if contained)
        - points: total number of points
        - withHoles: file contains hole-flags
    """
    f = open(fileName, 'r')
    contours = int(f.readline())
    holes  = 0
    points = 0
    withHoles = True
    for c in range(contours):
        pp = int(f.readline())
        x = 0
        if c == 0:
            # check for hole-flags
            try:
                holes += int(f.readline())
            except:
                withHoles = False
                x = 1
        else:
            if withHoles:
                holes += int(f.readline())
        [ f.readline() for p in range(pp-x) ]
        points += pp
    f.close()
    return contours, holes, points, withHoles