code: def _Open(self, path_spec=None, mode='rb'):
      
      if not path_spec:
        raise ValueError('Missing path specification.')
  
      file_system = resolver.Resolver.OpenFileSystem(
          path_spec, resolver_context=self._resolver_context)
  
      file_entry = file_system.GetFileEntryByPathSpec(path_spec)
      if not file_entry:
        file_system.Close()
        raise IOError('Unable to retrieve file entry.')
  
      self._file_system = file_system
      self._cpio_archive_file = self._file_system.GetCPIOArchiveFile()
      self._cpio_archive_file_entry = file_entry.GetCPIOArchiveFileEntry()
  
      self._current_offset = 0
docs: Opens the file-like object defined by path specification.
  
      Args:
        path_spec (Optional[PathSpec]): path specification.
        mode (Optional[str]): file access mode.
  
      Raises:
        AccessError: if the access to open the file was denied.
        IOError: if the file-like object could not be opened.
        OSError: if the file-like object could not be opened.
        PathSpecError: if the path specification is incorrect.
        ValueError: if the path specification is invalid.