Writes the given property list to the appropriate file on disk and returns
    the absolute filename.

    :param plist: dict
    :param label: string
    :param scope: oneOf(USER, USER_ADMIN, DAEMON_ADMIN, USER_OS, DAEMON_OS)

def write(label, plist, scope=USER):
    '''
    Writes the given property list to the appropriate file on disk and returns
    the absolute filename.

    :param plist: dict
    :param label: string
    :param scope: oneOf(USER, USER_ADMIN, DAEMON_ADMIN, USER_OS, DAEMON_OS)
    '''
    fname = compute_filename(label, scope)
    with open(fname, "wb") as f:
        plistlib.writePlist(plist, f)
    return fname