def findClosestSubPath(hdf5Object, path):
    """Find the closest existing path from the hdf5Object using a subset of the
    provided path.

    Returns None if no path found. It is possible if the path is a relative
    path.

    :param h5py.Node hdf5Object: An HDF5 node
    :param str path: A path
    :rtype: str
    """
    if path in ['', '/']:
        return '/'
    names = path.split('/')
    if path[0] == '/':
        names.pop(0)
    for i in range(len(names)):
        n = len(names) - i
        path2 = '/'.join(names[0:n])
        if path2 == '':
            return ''
        if path2 in hdf5Object:
            return path2
    if path[0] == '/':
        return '/'
    return None
