From: qydysky Date: Sun, 10 Jan 2021 02:57:21 +0000 (+0800) Subject: 99 X-Git-Tag: v0.3.6~3 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=48b2732f9fb8fbb639703e235e8ec882ff95755c;p=part%2F.git 99 --- diff --git a/Exec.go b/Exec.go index 0e0199f..32c6674 100644 --- a/Exec.go +++ b/Exec.go @@ -15,7 +15,7 @@ func (this *lexec) Run(hide bool,prog string,cmd ...string){ Ppart.PRun(hide,prog,cmd ...) } -func (this *lexec) Startf(pro ...*exec.Cmd){ +func (this *lexec) Start(pro ...*exec.Cmd){ Ppart.PStartf(pro) } diff --git a/Reqf.go b/Reqf.go index 1990258..d7ebb27 100644 --- a/Reqf.go +++ b/Reqf.go @@ -159,6 +159,7 @@ func (this *req) Reqf_1(val Rval) (error) { if _, err = io.Copy(out, Body); err != nil {out.Close();return err} out.Close() + if err = os.RemoveAll(filepath); err != nil {return err} if err = os.Rename(filepath+".dtmp", filepath); err != nil {return err} return nil } diff --git a/get/Get.go b/get/Get.go index e9d1b16..c8d8502 100644 --- a/get/Get.go +++ b/get/Get.go @@ -62,25 +62,24 @@ func SS2(source,stratS,endS string) (return_val []string,last_err error) { func SS(source,stratS,endS string, startI,lenI int) (string,error) { if stratS == "" && startI == 0 {return "", errors.New("no symbol to start")} if endS == "" && lenI == 0 {return "", errors.New("no symbol to stop")} - s := source var ts,te int if stratS != "" { - if tmp := strings.Index(s, stratS);tmp != -1{ts = tmp + len(stratS)} + if tmp := strings.Index(source, stratS);tmp != -1{ts = tmp + len(stratS)} } else if startI != 0 { - if startI < len(s){ts = startI} + if startI < len(source){ts = startI} } - if ts == 0 {return "", errors.New("no start symbol "+ stratS +" in " + s)} + if ts == 0 {return "", errors.New("no start symbol "+ stratS +" in " + source)} if endS != "" { - if tmp := strings.Index(s[ts:], endS);tmp != -1{te = ts + tmp} + if tmp := strings.Index(source[ts:], endS);tmp != -1{te = ts + tmp} } else if lenI != 0 { - if startI + lenI < len(s){te = startI + lenI} + if startI + lenI < len(source){te = startI + lenI} } - if te == 0 {return "", errors.New("no stop symbol "+ endS +" in " + s)} + if te == 0 {return "", errors.New("no stop symbol "+ endS +" in " + source)} - return s[ts:te], nil + return source[ts:te], nil }