// Clone - clones the dataset.  The target must be of the same type as
// the source.
clones the dataset.  The target must be of the same type as
the source.
// Clone - clones the dataset . The target must be of the same type as // the source .
func (d *Dataset) Clone(target string, props map[Prop]Property) (rd Dataset, err error) {
	var cprops C.nvlist_ptr
	if d.list == nil {
		err = errors.New(msgDatasetIsNil)
		return
	}
	if cprops, err = datasetPropertiesTonvlist(props); err != nil {
		return
	}
	defer C.nvlist_free(cprops)
	csTarget := C.CString(target)
	defer C.free(unsafe.Pointer(csTarget))
	if errc := C.dataset_clone(d.list, csTarget, cprops); errc != 0 {
		err = LastError()
		return
	}
	rd, err = DatasetOpen(target)
	return
}
func ( d * Dataset ) Clone ( target string , props map [ Prop ] Property ) ( rd Dataset , err error ) { var cprops C . nvlist_ptr if d . list == nil { err = errors . New ( msgDatasetIsNil ) return } if cprops , err = datasetPropertiesTonvlist ( props ) ; err != nil { return } defer C . nvlist_free ( cprops ) csTarget := C . CString ( target ) defer C . free ( unsafe . Pointer ( csTarget ) ) if errc := C . dataset_clone ( d . list , csTarget , cprops ) ; errc != 0 { err = LastError ( ) return } rd , err = DatasetOpen ( target ) return }
clones the dataset.
clones the dataset .