code: def _OpenFileObject(self, path_spec):
      
      if not path_spec.HasParent():
        raise errors.PathSpecError(
            'Unsupported path specification without parent.')
  
      file_object = resolver.Resolver.OpenFileObject(
          path_spec.parent, resolver_context=self._resolver_context)
  
      vhdi_file = pyvhdi.file()
      vhdi_file.open_file_object(file_object)
  
      if vhdi_file.parent_identifier:
        file_system = resolver.Resolver.OpenFileSystem(
            path_spec.parent, resolver_context=self._resolver_context)
  
        try:
          self._OpenParentFile(file_system, path_spec.parent, vhdi_file)
        finally:
          file_system.Close()
  
      self._sub_file_objects.append(file_object)
  
      self._parent_vhdi_files.reverse()
      self._sub_file_objects.reverse()
  
      return vhdi_file
docs: Opens the file-like object defined by path specification.
  
      Args:
        path_spec (PathSpec): path specification.
  
      Returns:
        pyvhdi.file: a file-like object.
  
      Raises:
        PathSpecError: if the path specification is incorrect.