Returns true if the file path equals other file path, false otherwise.

@since 1.2.0

@param FilePathInterface $filePath The other file path.

@return bool True if the file path equals other file path, false otherwise.
5595
public function equals(FilePathInterface $filePath): bool
    {
        return $this->getDrive() === $filePath->getDrive() && $this->isAbsolute() === $filePath->isAbsolute() && $this->getDirectoryParts() === $filePath->getDirectoryParts() && $this->getFilename() === $filePath->getFilename();
    }
825614
private function deleteCacheSubfoldersIfEmpty($filepath)
    {
        if ($this->cache_path == $filepath) {
            // Do not delete main cache folder itself.
            return true;
        }

        $filepath_exp = explode(DIRECTORY_SEPARATOR, $filepath);
        if (is_array($filepath_exp)) {
            for ($i = count($filepath_exp)-1; $i >= 0 ; $i--) {
                $dir = implode(DIRECTORY_SEPARATOR, $filepath_exp);
                $iterator = new \FilesystemIterator($dir);
                $isDirEmpty = !$iterator->valid();
                unset($iterator);

                if ($this->cache_path == $dir) {
                    // Do not delete main cache folder.
                    return true;
                } elseif (is_dir($dir) && !is_writable($dir)) {
                    // Directory is unable to delete.
                    return false;
                } elseif (is_dir($dir) && $isDirEmpty !== true) {
                    // Directory is not empty.
                    return true;
                } elseif (is_dir($dir) && $isDirEmpty === true && is_writable($dir) && $this->cache_path != $dir) {
                    rmdir($dir);
                    unset($filepath_exp[$i]);
                } else {
                    return true;
                }
            }
            unset($i);
        }
        unset($filepath_exp);

        return true;
    }
90481
public static function mkdir($filePath, $mode = 0777) {
        if (empty($filePath)) {
            return false;
        }
        if (!file_exists($filePath)) {
            mkdir($filePath, $mode);
        }
        return true;
    }
51814
public boolean isSameFile(JimfsPath path, FileSystemView view2, JimfsPath path2)
      throws IOException {
    if (!isSameFileSystem(view2)) {
      return false;
    }

    store.readLock().lock();
    try {
      File file = lookUp(path, Options.FOLLOW_LINKS).fileOrNull();
      File file2 = view2.lookUp(path2, Options.FOLLOW_LINKS).fileOrNull();
      return file != null && Objects.equals(file, file2);
    } finally {
      store.readLock().unlock();
    }
  }
475513
public function isRelativePath($path)
    {
        if (strlen($path) === 0) {
            return true;
        }

        if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
            return !preg_match('/^[a-z]+\:\\\\/i', $path);
        }

        return strpos($path, DIRECTORY_SEPARATOR) !== 0;
    }
458280
public function fileExists($containerName, $fileName, $relativePath)
    {
        return $this->fileUploadFacade->fileExists($containerName, $fileName, $relativePath);
    }
415192
protected function has_system_permission($filepath, $permissions) {
        if (in_array('r', $permissions)) {
            if (!is_readable($filepath)) {
                Log::info('Not readable path "' . $filepath . '"');
                return false;
            };
        }
        if (in_array('w', $permissions)) {
            if (!is_writable($filepath)) {
                Log::info('Not writable path "' . $filepath . '"');
                return false;
            }
        }
        return true;
    }
988064
@Override
    public boolean isSameFile(final Path path1, final Path path2) throws IOException {

        // Only equal if pointing to same FS
        final FileSystem fs1 = path1.getFileSystem();
        final FileSystem fs2 = path2.getFileSystem();
        if (fs1 != fs2) {
            return false;
        }

        // Same if the normalized form points to the same location
        final String normalized1 = path1.normalize().toString();
        final String normalized2 = path2.normalize().toString();
        return normalized1.equals(normalized2);
    }
1253453
protected function isWithinFilesystem($path)
    {
        $pathUrl = new Url($path);
        $fsUrl = $this->filesystem->url();

        if (!$pathUrl->scheme) {
            $pathUrl = $pathUrl->scheme('file');
        }

        if (!$fsUrl->scheme) {
            $fsUrl = $fsUrl->scheme('file');
        }

        if ($pathUrl->scheme != $fsUrl->scheme) {
            return false;
        }

        if (Helper::startsWith("$pathUrl->path", "$fsUrl->path")) {
            return true;
        }

        return $this->filesystem->exists($path);
    }
352568
protected function verifyChecksum(string $checksum, string $filePath) : bool
    {
        // Skip if checksum is empty.
        if (empty($checksum)) {
            return true;
        }

        return $checksum === $this->getServerChecksum($filePath);
    }
764218
public static function isRelativePath($path) {
        if ($path[0] == '~' || $path[0] == '.') {
            return true;
        }

        if ($path[0] == '/' && !is_file($path) && !is_dir($path)) {
            return true;
        }

        return false;
    }
941218
public function existsOnDFS( $filePath )
    {
        if ( file_exists( $this->makeDFSPath( $filePath ) ) )
        {
            return true;
        }

        // Verify that mount point is still there
        $filePathDir = substr( $filePath, 0, strpos( $filePath, '/' ) + 1 );
        $path = realpath( $this->getMountPoint() ). '/' . $filePathDir;
        if ( !file_exists( $path ) || !is_dir( $path ) )
        {
            throw new eZDFSFileHandlerBackendException( "NFS mount root $path not found" );
        }

        return false;
    }
775291
public function setFilePath( $filePath )
	{
		$this->filePath      = $filePath;
		$this->shortFilePath = str_replace( base_path() , '' , $filePath );

		return $this;
	}
165559
def match(self, filepath):
        
        for pattern in self.__pattern:
            if len(fnmatch.filter([filepath], pattern)) > 0:
                return True
        return False
466022
public static function isFile($path): bool
    {
        $path = self::clean($path);
        return file_exists($path) && is_file($path);
    }
583445
public static boolean exist(String filePath) {

        File f = new File(filePath);

        if( !f.isFile() ) {
            return false;
        }

        return true;
    }
463617
private function isInternalRoute($filepath)
    {
        foreach ($this->internalRouteDirPattern as $pattern) {
            if (preg_match($pattern, $filepath)) {
                return true;
            }
        }

        $filename = basename($filepath);
        foreach ($this->internalRouteFilePattern as $pattern) {
            if (preg_match($pattern, $filename)) {
                return true;
            }
        }

        return false;
    }