Remove SendOne since it does not make sense in context of this lib
This commit is contained in:
parent
46e9af7090
commit
5ddc9a9d76
43
sendrecv.go
43
sendrecv.go
|
@ -12,7 +12,6 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -128,48 +127,6 @@ func (d *Dataset) send(FromName string, outf *os.File, flags *SendFlags) (err er
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Dataset) SendOne(FromName string, outf *os.File, flags *SendFlags) (err error) {
|
|
||||||
var cfromname, ctoname *C.char
|
|
||||||
var dpath string
|
|
||||||
var lzc_send_flags C.struct_sendflags
|
|
||||||
|
|
||||||
if d.Type == DatasetTypeSnapshot || (len(FromName) > 0 && !strings.Contains(FromName, "#")) {
|
|
||||||
err = fmt.Errorf(
|
|
||||||
"Unsupported with snapshot. Use func Send() for that purpose.")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if flags.Replicate || flags.DoAll || flags.Props || flags.Dedup || flags.DryRun {
|
|
||||||
err = fmt.Errorf("Unsupported flag with filesystem or bookmark.")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if flags.LargeBlock {
|
|
||||||
lzc_send_flags.largeblock = booleanT(true)
|
|
||||||
}
|
|
||||||
if flags.EmbedData {
|
|
||||||
lzc_send_flags.embed_data = booleanT(true)
|
|
||||||
}
|
|
||||||
// if (flags.Compress)
|
|
||||||
// lzc_send_flags |= LZC_SEND_FLAG_COMPRESS;
|
|
||||||
if dpath, err = d.Path(); err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if len(FromName) > 0 {
|
|
||||||
if FromName[0] == '#' || FromName[0] == '@' {
|
|
||||||
FromName = dpath + FromName
|
|
||||||
}
|
|
||||||
cfromname = C.CString(FromName)
|
|
||||||
defer C.free(unsafe.Pointer(cfromname))
|
|
||||||
}
|
|
||||||
ctoname = C.CString(path.Base(dpath))
|
|
||||||
defer C.free(unsafe.Pointer(ctoname))
|
|
||||||
cerr := C.zfs_send_one(d.list.zh, cfromname, C.int(outf.Fd()), &lzc_send_flags, nil)
|
|
||||||
if cerr != 0 {
|
|
||||||
err = LastError()
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (d *Dataset) SendResume(outf *os.File, flags *SendFlags, receiveResumeToken string) (err error) {
|
func (d *Dataset) SendResume(outf *os.File, flags *SendFlags, receiveResumeToken string) (err error) {
|
||||||
if d.Type != DatasetTypeSnapshot {
|
if d.Type != DatasetTypeSnapshot {
|
||||||
err = fmt.Errorf("Unsupported method on filesystem or bookmark. Use func SendOne() for that purpose.")
|
err = fmt.Errorf("Unsupported method on filesystem or bookmark. Use func SendOne() for that purpose.")
|
||||||
|
|
Loading…
Reference in New Issue