returns the a file path or a resource url that can be handled by file function such as fopen
14105
protected function getPath(string $hash, ?string $cacheContext = null, bool $confirmed = true, string $ds = '/'): string
    {
        $folderName = $this->getBaseUrl();

        if (!$confirmed) {
            $folderName .= $ds . 'uploads';
        }

        //isolate cached files
        if ($cacheContext) {
            $folderName .= $ds . 'cache' . $ds . $cacheContext;
        }

        //in order to avoid a folder with a to big number of files in
        if ($confirmed) {
            $folderName .= $ds . substr($hash, 0, 3);
        }

        //create folder if missing
        if (!file_exists($folderName)) {
            mkdir($folderName, 0777, true);
        }

        return $folderName . $ds . $hash;
    }
1155662
function getFilePath (cfg, req) {
	const urlParsed = req[cfg.parsedURLName] || url.parse(req.url);
	return path.join(cfg.documentRoot, (urlParsed.pathname || '/'));
}
340027
def DataPath():
    
    return os.path.abspath('%s/data'%(os.path.dirname( \
        os.path.realpath(__file__))))
120216
def _resource_context(fn):
    
    return os.path.join(
        os.path.dirname(__file__),
        DES_DIR,
        fn
    )
1321859
def open_resource(self, path: FilePath, mode: str='rb') -> IO[AnyStr]:
        
        if mode not in {'r', 'rb'}:
            raise ValueError('Files can only be opened for reading')
        return open(self.root_path / file_path_to_path(path), mode)
613184
def get_file(fname, datapath=datapath):
    
    # download location
    datapath = pathlib.Path(datapath)
    datapath.mkdir(parents=True, exist_ok=True)

    dlfile = datapath / fname
    if not dlfile.exists():
        print("Attempting to download file {} from {} to {}.".
              format(fname, webloc, datapath))
        try:
            dl_file(url=webloc+fname, dest=dlfile)
        except BaseException:
            warnings.warn("Download failed: {}".format(fname))
            raise
    return dlfile
302469
function getFilePaths(strPath = '', exts = ['.css']) {

		if (validUrl.isUri(strPath)){

			switch(exts[0]) {
				case '.css':
					tmpCSSPaths.push(strPath);
					break;
				case '.html':
				case '.htm':
					tmpHTMLPaths.push(strPath);
					break;
				case '.js':
					tmpJSPaths.push(strPath);
					break;
			}
		} else {

			try {
				// Query the entry
				fileStats = fs.lstatSync(strPath);

				// directory given
				if (fileStats.isDirectory()) {

					var dir = strPath;

					//traverse directory for .ext strPath
					try {

						fs.readdirSync(dir).forEach(filenameRead => {

							fileFound = false;

							for (m = 0, count = exts.length; m < count; ++m) {

								if (path.extname(filenameRead) == exts[m]) {
									fileFound = true;
								}
							}

							if (fileFound) {

								switch(exts[0]) {
									case '.css':
										tmpCSSPaths.push(dir + '/' + filenameRead);
										break;
									case '.html':
									case '.htm':
										tmpHTMLPaths.push(dir + '/' + filenameRead);
										break;
									case '.js':
										tmpJSPaths.push(dir + '/' + filenameRead);
										break;
								}

							} else if (path.extname(filenameRead) == '') {

								switch(exts[0]) {
									case '.css':
										getFilePaths(strPath+'/'+filenameRead, ['.css']);
										break;
									case '.html':
									case '.htm':
										getFilePaths(strPath+'/'+filenameRead, ['.html','.htm']);
										break;
									case '.js':
										getFilePaths(strPath+'/'+filenameRead, ['.js']);
										break;
								}

							}
						});



					} catch (e) {
						
						console.log(error("Directory read error: Something went wrong while reading the directory, check your [html] in " + configFileLocation + " and please try again."));
						console.log(e);
						process.exit(1);
					}

				} else if (fileStats.isFile()) { //filepath given

					if (exts.join(",").indexOf(strPath.substr(strPath.lastIndexOf('.') + 1)) != -1) {
						switch(exts[0]) {
							case '.css':
								tmpCSSPaths.push(strPath);
								break;
							case '.html':
							case '.htm':
								tmpHTMLPaths.push(strPath);
								break;
							case '.js':
								tmpJSPaths.push(strPath);
								break;
						}
					}
					
				}
			} catch (e) {
				
				console.log(error("CSS File read error: Something went wrong while reading the file(s), check your [html] in " + configFileLocation + " and please try again."));
				console.log(e);
				process.exit(1);
			}

		} //end of url check
	}
1193817
def from_file_url(url):
    
    if url.startswith('file://'):
        url = url[len('file://'):].replace('/', os.path.sep)

    return url
1309482
def dirpath(self):
        """"""
        if self.isfile():
            return Path(op.dirname(self._fspath))
        else:
            return Path(self)
1355458
def file_path

      self.path= File.join(Dir.pwd, uri_file_name) unless path
      if File.directory?(path)
        self.path= File.join(self.path, uri_file_name)
      end

      self.path

    end
962434
function() {
                var absPath = _path.resolve(_folderPath);
                if (!_fs.existsSync(absPath)) {
                    return '[DOES NOT EXIST]';
                } else {
                    var stats = _fs.lstatSync(absPath);
                    if (stats.isDirectory()) {
                        return '[DIR]';
                    } else if (stats.isSymbolicLink()) {
                        return '[LINK]';
                    } else {
                        return '[FILE]';
                    }
                }
            }
821495
def get_file_fullpath(name, dirname=None):
        # type: (AnyStr, Optional[AnyStr]) -> Optional[AnyStr]
        """"""
        if name is None:
            return None
        if is_string(name):
            name = str(name)
        else:
            raise RuntimeError('The input function name or path must be string!')
        for sep in ['\\', '/', os.sep]:  # Loop all possible separators
            if sep in name:  # name is full path already
                name = os.path.abspath(name)
                return name
        if dirname is not None:
            dirname = os.path.abspath(dirname)
            name = dirname + os.sep + name
        return name
557790
def get_file(self,
                 path,
                 dest='',
                 makedirs=False,
                 saltenv='base',
                 gzip=None,
                 cachedir=None):
        '''
        
        '''
        path = self._check_proto(path)
        fnd = self._find_file(path, saltenv)
        fnd_path = fnd.get('path')
        if not fnd_path:
            return ''

        return fnd_path
1051028
def load(self, relpath, rsc=None, mode='r', useFilepath=None):
        
        filepath = self.find(relpath, rsc, useFilepath=useFilepath)
        
        # parse a resource object
        if filepath.startswith(':'):
            return QtCore.QFile(filepath)
        
        # parse a filepath
        elif os.path.isfile(filepath):
            return open(filepath, mode)
        
        # return an unknown object
        else:
            return None
304698
public function getFilePath()
    {
        $returnValue = (string) '';

        if (!empty($this->filePath)){
        	$returnValue = $this->filePath;
        }

        return (string) $returnValue;
    }
1184618
function getPath(path, callback) {
  fs.lstat(path, function(err, stats) {
    if(err) return callback(err);

    // Check if it's a link
    if(stats.isSymbolicLink()) fs.readlink(path, callback);

    callback(err, path);
  });
}
969706
def find(self, relpath, rsc=None, useFilepath=None):
        
        self.init()
        
        # load the default resource information
        if rsc is None:
            try:
                key = relpath.replace('\\', '/').split('/')[0]
                rsc = self.default(key)
            except IndexError:
                return ''
        
        # determine the filepath location
        relpath = os.path.normpath(nativestring(relpath))
        rscpath = self.resourcePath()
        
        if useFilepath is None:
            useFilepath = self.useFilepath()
        
        # return from the filesystem
        if useFilepath and rscpath:
            if rsc and isinstance(rsc, XResourceManager):
                return rsc.find(relpath, useFilepath=useFilepath)
            elif rsc:
                filepath = os.path.join(rscpath, rsc, relpath)
            else:
                filepath = os.path.join(rscpath, relpath)
            
            if os.path.exists(filepath):
                return filepath
        
        # return resource
        if isinstance(rsc, XResourceManager):
            return rsc.find(relpath, useFilepath=useFilepath)
        elif rsc:
            return ':{0}/{1}'.format(rsc, relpath.replace(os.path.sep, '/'))
        else:
            return ':{0}'.format(relpath.replace(os.path.sep, '/'))