Checks to see if the inputed path represents an existing file or directory.

        :param      relpath     | <str>
                    rsc         | <str>
                    useFilepath | <bool> or None
166684
def exists(self, relpath, rsc=None, useFilepath=None):
        
        path = self.find(relpath, rsc, useFilepath)
        if path.startswith(':'):
            return QtCore.QResource(path).isValid()
        else:
            return os.path.exists(path)
146525
def _is_svc(svc_path):
    '''
    
    '''
    run_file = os.path.join(svc_path, 'run')
    if (os.path.exists(svc_path)
         and os.path.exists(run_file)
         and os.access(run_file, os.X_OK)):
        return True
    return False
1302474
def is_valid_file(path):
    '''  '''
    return os.path.exists(path) and os.path.isfile(path)
22312
def file_is_present(self, file_path):
        
        p = self.p(file_path)
        if not os.path.exists(p):
            return False
        if not os.path.isfile(p):
            raise IOError("%s is not a file" % file_path)
        return True
1080952
def GetFileEntryByPath(self, path):
    
    if path is None:
      return None

    file_entry_type, _ = self._paths.get(path, (None, None))
    if not file_entry_type:
      return None

    path_spec = fake_path_spec.FakePathSpec(location=path)
    return fake_file_entry.FakeFileEntry(
        self._resolver_context, self, path_spec,
        file_entry_type=file_entry_type)
467214
def relpath(path, start=posixpath.curdir):
    """"""
    if not path:
        raise ValueError("no path specified")

    start_list = posixpath.abspath(start).split(posixpath.sep)
    path_list = posixpath.abspath(path).split(posixpath.sep)

    # Work out how much of the filepath is shared by start and path.
    i = len(posixpath.commonprefix([start_list, path_list]))

    rel_list = [posixpath.pardir] * (len(start_list) - i) + path_list[i:]
    if not rel_list:
        return posixpath.curdir
    return posixpath.join(*rel_list)
1230238
def is_reparse_point(path):
	
	res = api.GetFileAttributes(path)
	return (
		res != api.INVALID_FILE_ATTRIBUTES
		and bool(res & api.FILE_ATTRIBUTE_REPARSE_POINT)
	)
311004
def check_path(path, otherwise):
    

    if os.path.exists(path):
        print("WARNING: Path '%s' already exists; skipping" % path)
    else:
        otherwise(path)
487494
def check_file_existence(path):
    

    pathvalidate.validate_file_path(path)

    if not os.path.lexists(path):
        raise FileNotFoundError(path)

    if os.path.isfile(path):
        logger.debug("file found: " + path)
        return FileType.FILE

    if os.path.isdir(path):
        logger.debug("directory found: " + path)
        return FileType.DIRECTORY

    if os.path.islink(path):
        logger.debug("link found: " + path)
        return FileType.LINK

    raise RuntimeError()
980560
def file_is_present(self, file_path):
        
        real_path = self.cont_path(file_path)
        if not os.path.exists(real_path):
            return False
        if not os.path.isfile(real_path):
            raise IOError("%s is not a file" % file_path)
        return True
1079722
def check_path(file_path):
    '''
        
    '''
    directory = os.path.dirname(file_path)
    if directory != '':
        if not os.path.exists(directory):
            os.makedirs(directory, 0o775)
1029696
def is_valid(file_path):
    
    from os import path, stat

    can_open = False

    try:
        with open(file_path) as fp:
            can_open = True
    except IOError:
        return False

    is_file = path.isfile(file_path)

    return path.exists(file_path) and is_file and stat(file_path).st_size > 0
1107577
def check_directory_path(self, path):
        
        if os.path.isdir(path) is not True:
            msg = "Directory Does Not Exist {}".format(path)
            raise OSError(msg)
1251741
def check_path(path):
    
    if path is None or path == b'' or path.startswith(b'/'):
        raise ValueError("illegal path '%s'" % path)

    if (
        (sys.version_info[0] >= 3 and not isinstance(path, bytes)) and
        (sys.version_info[0] == 2 and not isinstance(path, str))
    ):
        raise TypeError("illegale type for path '%r'" % path)

    return path
275163
def check_path(self, path):
        
        path = os.path.abspath(path)
        if os.path.exists(path):
            return path
        else:
            utils.die("input file does not exists:\n  {}".format(path))
1189572
def is_root_path(self, filename):
        """"""
        test_filename = filename + '/'
        for root_dir in self.root_dirs:
            if test_filename.startswith(root_dir):
                return True
        return False
122147
def is_directory(self, path):
        '''

        '''
        node = self.get_node(path)
        if not node:
            return False
        return node.is_directory