code: def _ExtractPathSpecsFromFileSystem(
        self, path_spec, find_specs=None, recurse_file_system=True,
        resolver_context=None):
      
      try:
        file_system = path_spec_resolver.Resolver.OpenFileSystem(
            path_spec, resolver_context=resolver_context)
      except (
          dfvfs_errors.AccessError, dfvfs_errors.BackEndError,
          dfvfs_errors.PathSpecError) as exception:
        logger.error(
            'Unable to open file system with error: {0!s}'.format(exception))
        return
  
      try:
        if find_specs:
          searcher = file_system_searcher.FileSystemSearcher(
              file_system, path_spec)
          for extracted_path_spec in searcher.Find(find_specs=find_specs):
            yield extracted_path_spec
  
        elif recurse_file_system:
          file_entry = file_system.GetFileEntryByPathSpec(path_spec)
          if file_entry:
            for extracted_path_spec in self._ExtractPathSpecsFromDirectory(
                file_entry):
              yield extracted_path_spec
  
        else:
          yield path_spec
  
      except (
          dfvfs_errors.AccessError, dfvfs_errors.BackEndError,
          dfvfs_errors.PathSpecError) as exception:
        logger.warning('{0!s}'.format(exception))
  
      finally:
        file_system.Close()
docs: Extracts path specification from a file system within a specific source.
  
      Args:
        path_spec (dfvfs.PathSpec): path specification of the root of
            the file system.
        find_specs (Optional[list[dfvfs.FindSpec]]): find specifications.
        recurse_file_system (Optional[bool]): True if extraction should
            recurse into a file system.
        resolver_context (Optional[dfvfs.Context]): resolver context.
  
      Yields:
        dfvfs.PathSpec: path specification of a file entry found in
            the file system.