return file and line number of called position as string

@param int $back
@param bool $fullpath

@return string
166343
public static function callerAsString( $back = 0, $fullpath = FALSE )
    {
        list( $file, $line ) = self::caller( $back );

        if ( $fullpath ){
            return "$file($line)";
        }

        $file = basename($file);

        return "$file($line)";
    }
802250
public function getList( $full = NULL )
	{
		if( $full )
			return $this->list;
		$list	= array();
		foreach( $this->list as $pathName => $fileData )
			$list[$pathName]	= $fileData['fileName'];
		return $list;
	}
468514
protected function get_stripped_file_contents($fullpath) {

        $source = file_get_contents($fullpath);
        $tokens = token_get_all($source);
        $output = '';
        $doprocess = false;
        foreach ($tokens as $token) {
            if (is_string($token)) {
                // Simple one character token.
                $id = -1;
                $text = $token;
            } else {
                // Token array.
                list($id, $text) = $token;
            }
            switch ($id) {
                case T_WHITESPACE:
                case T_COMMENT:
                case T_ML_COMMENT:
                case T_DOC_COMMENT:
                    // Ignore whitespaces, inline comments, multiline comments and docblocks.
                    break;
                case T_OPEN_TAG:
                    // Start processing.
                    $doprocess = true;
                    break;
                case T_CLOSE_TAG:
                    // Stop processing.
                    $doprocess = false;
                    break;
                default:
                    // Anything else is within PHP tags, return it as is.
                    if ($doprocess) {
                        $output .= $text;
                        if ($text === 'function') {
                            // Explicitly keep the whitespace that would be ignored.
                            $output .= ' ';
                        }
                    }
                    break;
            }
        }

        return $output;
    }
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
1187325
public static function getLines($filename, $reverse = false, $maxLines = null, $lineCallback = null) {
		if (file_exists ( $filename )) {
			if ($reverse && isset ( $maxLines )) {
				$result = [ ];
				$fl = fopen ( $filename, "r" );
				for($x_pos = 0, $ln = 0, $lines = [ ]; fseek ( $fl, $x_pos, SEEK_END ) !== - 1; $x_pos --) {
					$char = fgetc ( $fl );
					if ($char === "\n") {
						if (is_callable ( $lineCallback )) {
							$lineCallback ( $result, $lines [$ln] );
						} else {
							$result [] = $lines [$ln];
						}
						if (isset ( $maxLines ) && sizeof ( $result ) >= $maxLines) {
							fclose ( $fl );
							return $result;
						}
						$ln ++;
						continue;
					}
					$lines [$ln] = $char . ((array_key_exists ( $ln, $lines )) ? $lines [$ln] : '');
				}
				fclose ( $fl );
				return $result;
			} else {
				return self::getLinesByLine ( $filename, $reverse, $maxLines, $lineCallback );
			}
		}
		return [ ];
	}
305794
protected function getFullPath($path, $verify = false) {
        $full_path = $this->cleanPath($this->path_to_files . '/' . $path);

        if ($verify === true) {
            if (!file_exists($full_path) || !$this->is_valid_path($full_path)) {
                $langKey = is_dir($full_path) ? 'DIRECTORY_NOT_EXIST' : 'FILE_DOES_NOT_EXIST';
                $this->error($langKey, [$path]);
            }
        }
        return $full_path;
    }
977046
public function get_filecontent($path) {
        $fullpath = $this->tempdir . '/' . $path;
        if (is_file($fullpath) && is_readable($fullpath)) {
            return file_get_contents($fullpath);
        }
        return false;
    }
734897
public function returnPath($returnPath = null)
    {
        if (!func_num_args()) {
            return $this->_returnPath;
        }
        $this->_returnPath = $returnPath;
        $headers = $this->headers();
        $headers['Return-Path'] = '<' . Mime::encodeEmail($returnPath) .'>';
        return $this;
    }
902146
protected static String getPath(String fullPath)
   {
      int sl = fullPath.lastIndexOf('/');
      return sl > 0 ? "/" + fullPath.substring(0, sl) : "/";
   }
927095
public static function saveFile(string $fullPath, string $content)
    {
        if (file_exists($fullPath)) {
            $arrFilePath = explode(DIRECTORY_SEPARATOR, $fullPath);
            $fileName = array_pop($arrFilePath);
            $newFileName = self::iterateFileName($fileName);
            $arrFilePath[] = $newFileName;
            $newFullPath = implode(DIRECTORY_SEPARATOR, $arrFilePath);
            return self::saveFile($newFullPath, $content);
        }
        $file = fopen($fullPath, "w");
        fputs($file, $content);
        fclose($file);
        chmod($fullPath, 0775);
        return $fullPath;
    }
12241
public function createBackup($originalPath)
    {
        // Bail if file does not exist
        if (!file_exists($originalPath)) {
            return false;
        }

        $pathinfo = pathinfo($originalPath);

        $backupPrefered = $pathinfo['dirname'] . '/' . $pathinfo['filename'] . '.' . $pathinfo['extension'] . '.bkp';
        $backupFile = $backupPrefered;

        $i = 0;
        while (file_exists($backupFile)) {
            $i++;
            $backupFile = $backupPrefered . $i;
        }

        if (copy($originalPath, $backupFile)) {
            return $backupFile;
        }

        return false;
    }
281205
protected function getFullPath($path, $verify = false)
	{
		$full_path = $this->rootDirectory . rawurldecode($path);
		$full_path = $this->cleanPath(ltrim($full_path, '/'));
		$s3_path = $this->getS3WrapperPath($full_path);

		$isValid = $this->is_valid_path($s3_path);
		if($verify === true && $isValid) {
			$isValid = file_exists($s3_path) && $isValid;
		}
		if(!$isValid) {
			$langKey = $this->isDir($s3_path) ? 'DIRECTORY_NOT_EXIST' : 'FILE_DOES_NOT_EXIST';
            $this->error($langKey, [$path]);
		}

		return $s3_path;
	}
1346551
def fullpath(self):
        
        return str(os.path.join(self.path, self.directory))
797143
protected static String getName(String fullPath)
   {
      int sl = fullPath.lastIndexOf('/');
      return sl >= 0 ? fullPath.substring(sl + 1) : fullPath;
   }
969192
def get_fullpath(self, withext=True):
        
        p = self.get_path(self._obj)
        n = self.get_name(self._obj, withext)
        fp = os.path.join(p,n)
        return os.path.normpath(fp)
1066861
public static function mimetype_from_file($fullpath) {
        if (file_exists($fullpath)) {
            // The type is unknown. Attempt to look up the file type now.
            $finfo = new finfo(FILEINFO_MIME_TYPE);
            return mimeinfo_from_type('type', $finfo->file($fullpath));
        }

        return 'document/unknown';
    }
1367918
public function timestampedFileName( $extension, $fullpath = true ) {
		$book_title = ( get_bloginfo( 'name' ) ) ? get_bloginfo( 'name' ) : __( 'book', 'pressbooks' );
		$book_title_slug = sanitize_file_name( $book_title );
		$book_title_slug = str_replace( [ '+' ], '', $book_title_slug ); // Remove symbols which confuse Apache (Ie. form urlencoded spaces)
		$book_title_slug = sanitize_file_name( $book_title_slug ); // str_replace() may inadvertently create a new bad filename, sanitize again for good measure.

		if ( $fullpath ) {
			$path = static::getCoversFolder();
		} else {
			$path = '';
		}

		$filename = $path . $book_title_slug . '-cover-' . time() . '.' . ltrim( $extension, '.' );

		return $filename;
	}