code: def _Open(self, path_spec=None, mode='rb'):
      
      if not path_spec:
        raise ValueError('Missing path specification.')
  
      data_stream = getattr(path_spec, 'data_stream', None)
      if data_stream:
        raise errors.NotSupported(
            'Open data stream: {0:s} not supported.'.format(data_stream))
  
      self._file_system = resolver.Resolver.OpenFileSystem(
          path_spec, resolver_context=self._resolver_context)
  
      file_entry = self._file_system.GetFileEntryByPathSpec(path_spec)
      if not file_entry:
        raise IOError('Unable to open file entry.')
  
      fsapfs_file_entry = file_entry.GetAPFSFileEntry()
      if not fsapfs_file_entry:
        raise IOError('Unable to open APFS file entry.')
  
      self._fsapfs_file_entry = fsapfs_file_entry
docs: Opens the file-like object defined by path specification.
  
      Args:
        path_spec (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.
        NotSupported: if a data stream, like the resource or named fork, is
            requested to 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.