]> 127.0.0.1 Git - part/.git/commitdiff
34
authorqydysky <qydysky@foxmail.com>
Tue, 4 Aug 2020 01:28:47 +0000 (09:28 +0800)
committerqydysky <qydysky@foxmail.com>
Tue, 4 Aug 2020 01:28:47 +0000 (09:28 +0800)
CheckFile.go

index f66ea4ee95bb9cc64c4b7681167b2a1443a71af0..7f03df92d4f518da2d8024b7b76014aa747d245e 100644 (file)
@@ -11,7 +11,9 @@ import (
        "io/ioutil"
 )
 
-type checkfile struct {}
+type checkfile struct {
+       RV []interface{}
+}
 
 func Checkfile() *checkfile{
     return &checkfile{}
@@ -47,16 +49,19 @@ func (this *checkfile) Build(checkFile,root,checkDir,SplitString string,usemd5 b
 
 }
 
-func (this *checkfile) IsExist(f string) bool {
+func (t *checkfile) IsExist(f string) bool {
        _, err := os.Stat(f)
        if err != nil {
                if os.IsNotExist(err) {
+                       t.RV = append(t.RV,false,nil)
                        return false
                }else{
                        Logf().E(err)
+                       t.RV = append(t.RV,false,err)
                        return false
                }
        }
+       t.RV = append(t.RV,true,nil)
        return true
 }