Parameters
    ----------
    dir_path : str
        Directory path.

    Returns
    -------
    bool
        ``True`` if :data:`dir_path` is a link *or* junction.
168598
def _islinklike(dir_path):
    '''
    
    '''
    dir_path = ph.path(dir_path)
    if platform.system() == 'Windows':
        if dir_path.isjunction():
            return True
    elif dir_path.islink():
        return True
    return False
394019
def local_path(path):
    
    current = os.path.dirname(__file__)
    root = current
    return os.path.abspath(os.path.join(root, path))
732054
def safe_dir(sub_dir=None):
    
    safe_relative_path = os.path.join(
        os.path.dirname(__file__), '../')
    return os.path.abspath(
        os.path.join(safe_relative_path, sub_dir))
1079722
def check_path(file_path):
    '''
        
    '''
    directory = os.path.dirname(file_path)
    if directory != '':
        if not os.path.exists(directory):
            os.makedirs(directory, 0o775)
1346551
def fullpath(self):
        
        return str(os.path.join(self.path, self.directory))
58216
private boolean isDirectoryTraverse(StringBuffer path)
	{
			
		boolean directoryTraverse = false;
			
		String matchString = path.toString();
			
		//PM82876 Start
		if (WCCustomProperties.ALLOW_DOTS_IN_NAME) {
		    // The fileName can have .. , check for the failing conditions only.
		    if (matchString.indexOf("..") > -1) {
		        if( (matchString.indexOf("/../") > -1) || (matchString.indexOf("\\..\\") > -1) || 
		                        matchString.startsWith("../") || matchString.endsWith("/..") || 
		                        matchString.startsWith("..\\")|| matchString.endsWith("\\..")) 
		        {
		            directoryTraverse = true;
		            if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
		                logger.logp(Level.FINE, CLASS_NAME, "isDirectoryTraverse", "bad path :" + matchString);
		        }
		    }    
		}
                else{//PM82876 End

                    /**
                     * Do not allow ".." to appear in a path as it allows one to serve files from anywhere within
                     * the file system.
                     * Also check to see if the path or URI ends with '/', '\', or '.' .
                     * PQ44346 - Allow files on DFS to be served.
                     */
                    if ( (matchString.lastIndexOf("..") != -1) && (!matchString.startsWith("/...") )) 
                    {
                        directoryTraverse = true;
                    }

                }
		if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE))
			logger.logp(Level.FINE, CLASS_NAME,"isDirectoryTraverse", "returning" + directoryTraverse + " , matchstring :" + matchString);
			
		return directoryTraverse;
	}
437328
def working_directory(path):
    
    prev_cwd = os.getcwd()
    os.chdir(path)
    try:
        yield
    finally:
        os.chdir(prev_cwd)
243806
def ensure_path_exists(dir_path):
    
    if not os.path.exists(dir_path):
        mkdir(dir_path)
        return True
    return False
789810
def verify_dir_structure(full_path):
    '''

    '''
    if full_path == None:
        return False
    r = True
    for d2c in PREDEFINED_DIR_NAMES:
        #if d2c == "s2":
        #    d2c = ".s2"
        cp2c = os.path.join(full_path, d2c)  #complete path to check
        if not os.path.isdir(cp2c):
            r = False
            break
        else:  #exists, let's check it's writable
            if not os.access(cp2c, os.W_OK): 
                r = False
                break
    return r
56887
def _absolute(self, path):
        
        path = FilePath(path)
        if isabs(path):
            return path
        else:
            # these are both Path objects, so joining with + is acceptable
            return self.WorkingDir + path
983152
def is_directory (self):
        
        filename = self.get_os_filename()
        return os.path.isdir(filename) and not os.path.islink(filename)
970979
def _rel_path(self, path, basepath=None):
        
        basepath = basepath or self.src_dir
        return path[len(basepath) + 1:]
1262796
def ensure_dir_exists(path):
    
    dir_path = os.path.dirname(path)
    if not os.path.exists(dir_path):
        os.makedirs(dir_path)
1275216
def is_train_dir(dir_: str) -> bool:
    """"""
    return path.exists(path.join(dir_, CXF_CONFIG_FILE)) and \
           path.exists(path.join(dir_, CXF_TRACE_FILE)) and \
           path.exists(path.join(dir_, CXF_LOG_FILE))
884903
def ensure_dir(self, *path_parts):
        
        path = self.getpath(*path_parts)
        ensure_directory(path)
        return path
465060
def isfile(self, str_path):
            

            b_isFile            = False
            if self.isdir(str_path):
                b_isFile        = False
            else:
                str_parentDir   = '/'.join(str_path.split('/')[0:-1])
                str_fileName    = str_path.split('/')[-1]
                if self.cd(str_parentDir)['status']:
                    l_files = self.lsf(str_parentDir)
                    if any(str_fileName in f for f in l_files):
                        b_isFile    = True
            return b_isFile
857995
def isfile(self, path, follow_symlinks=True):
        
        return self._is_of_type(path, S_IFREG, follow_symlinks)