code: def _pour(opener, flags=0, *args, **kwargs):
      
  
      with _enumerator(opener,
                       *args,
                       entry_cls=_ArchiveEntryItState,
                       **kwargs) as r:
          ext = libarchive.calls.archive_write.c_archive_write_disk_new()
          libarchive.calls.archive_write.c_archive_write_disk_set_options(
                  ext,
                  flags
              )
  
          for state in r:
              yield state
  
              if state.selected is False:
                  continue
  
              r = libarchive.calls.archive_write.c_archive_write_header(
                      ext,
                      state.entry_res)
  
              buff = ctypes.c_void_p()
              size = ctypes.c_size_t()
              offset = ctypes.c_longlong()
  
              while 1:
                  r = libarchive.calls.archive_read.\
                          c_archive_read_data_block(
                              state.reader_res,
                              ctypes.byref(buff),
                              ctypes.byref(size),
                              ctypes.byref(offset))
  
                  if r == libarchive.constants.archive.ARCHIVE_EOF:
                      break
                  elif r != libarchive.constants.archive.ARCHIVE_OK:
                      message = c_archive_error_string(state.reader_res)
                      raise libarchive.exception.ArchiveError(
                              "Pour failed: (%d) [%s]" % (r, message))
  
                  r = libarchive.calls.archive_write.c_archive_write_data_block(
                          ext,
                          buff,
                          size,
                          offset)
  
              r = libarchive.calls.archive_write.\
                      c_archive_write_finish_entry(ext)
docs: A flexible pouring facility that knows how to enumerate entry data.