code: def FileEntryExistsByPathSpec(self, path_spec):
      
      # Opening a file by identifier is faster than opening a file by location.
      fsapfs_file_entry = None
      location = getattr(path_spec, 'location', None)
      identifier = getattr(path_spec, 'identifier', None)
  
      try:
        if identifier is not None:
          fsapfs_file_entry = self._fsapfs_volume.get_file_entry_by_identifier(
              identifier)
        elif location is not None:
          fsapfs_file_entry = self._fsapfs_volume.get_file_entry_by_path(location)
  
      except IOError as exception:
        raise errors.BackEndError(exception)
  
      return fsapfs_file_entry is not None
docs: Determines if a file entry for a path specification exists.
  
      Args:
        path_spec (PathSpec): path specification.
  
      Returns:
        bool: True if the file entry exists.
  
      Raises:
        BackEndError: if the file entry cannot be opened.